Commit 8b0856db authored by Roberto Loayza Miljanovich's avatar Roberto Loayza Miljanovich

Merge branch 'dev_mg' into 'dev_jm'

Dev mg

See merge request ByteBot/web/bytebot-service!8
parents 5465befc 5239389e
package com.bytesw.bytebot.bean;
import com.google.gson.annotations.Expose;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
public class ProcessETLBean implements Serializable {
@Expose
private int id;
@Expose
private String name;
@Expose
private long version;
}
......@@ -23,7 +23,9 @@ public class SchedulerTaskBean implements Serializable {
@Expose
private String stringParameters;
@Expose
private String calendarID;
private String calendar;
@Expose
private String calendarName;
@Expose
private int idEtl;
}
package com.bytesw.bytebot.controller;
import com.bytesw.bytebot.bean.CalendarBean;
import com.bytesw.bytebot.bean.ProcessETLBean;
import com.bytesw.bytebot.service.CalendarService;
import com.bytesw.bytebot.service.ProcessETLService;
import com.bytesw.xdf.annotation.ProgramSecurity;
import com.bytesw.xdf.controller.XDFController;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController()
@RequestMapping("/service/settings/ProcessETL")
@ProgramSecurity("PROCESSETL")
@Log4j2
public class ProcessETLController extends XDFController<ProcessETLBean, Integer> {
public ProcessETLController(ProcessETLService service) {
super(service);
}
}
package com.bytesw.bytebot.model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.envers.Audited;
import javax.persistence.*;
import java.io.Serializable;
@Audited
@Entity
@Table(name = "avb_process_etl")
@NamedQuery(name = "ProcessETL.findByPK", query = "Select u from ProcessETL u where u.id = ?1")
@Getter
@Setter
@EqualsAndHashCode
@ToString(exclude = "id")
public class ProcessETL implements Serializable {
@Id
@Column(name = "etl_id")
private int id;
@Version
@Column(name = "etl_version")
@Basic(optional = false)
private long version;
@Column(name = "etl_name", nullable = false)
private String name;
}
......@@ -5,8 +5,6 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.envers.Audited;
import javax.persistence.*;
......@@ -16,7 +14,7 @@ import java.math.BigInteger;
//@Audited
@Entity
@Table(name = "AVB_SCHEDULER_TASK")
@NamedQuery(name = "SchedulerTask.findByPK", query = "Select u from SchedulerTask u where u.id = ?1")
@NamedQuery(name = "SchedulerTasks.findByPK", query = "Select u from SchedulerTask u where u.id = ?1")
@Getter
@Setter
@EqualsAndHashCode
......@@ -47,12 +45,15 @@ public class SchedulerTask implements Serializable {
@Column(name = "SHTA_PARAM")
private String stringParameters;
@Column(name = "CALE_ID")
private String calendarID;
@ManyToOne(optional = false)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "cale_id", referencedColumnName = "cale_id", nullable = false)
@JoinColumn(name = "CALE_ID", referencedColumnName = "CALE_ID", nullable = false)
private Calendar calendar;
/*@ManyToOne(optional = false)
@JoinColumn(name = "ETL_ID", referencedColumnName = "ETL_ID", nullable = false)
private ProcessETL processETL;*/
@Column(name = "ETL_ID")
private int processETL;
}
package com.bytesw.bytebot.repository;
import com.bytesw.bytebot.model.ProcessETL;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;
public interface ProcessETLRepository extends CrudRepository<ProcessETL, Integer>, JpaSpecificationExecutor<ProcessETL> {
}
package com.bytesw.bytebot.service;
import com.bytesw.bytebot.bean.CalendarBean;
import com.bytesw.bytebot.bean.ProcessETLBean;
import com.bytesw.bytebot.model.Calendar;
import com.bytesw.bytebot.model.ProcessETL;
import com.bytesw.bytebot.repository.ProcessETLRepository;
import com.bytesw.xdf.service.XDFService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class ProcessETLService extends XDFService<ProcessETL, ProcessETLBean, Integer> {
protected ProcessETLService(ProcessETLRepository repository) {
super(repository);
}
@Override
protected ProcessETL toModel(ProcessETL model, ProcessETLBean bean) {
if (model == null) {
model = new ProcessETL();
}
BeanUtils.copyProperties(bean, model);
return model;
}
@Override
protected ProcessETLBean toBean(ProcessETL model) {
ProcessETLBean bean = new ProcessETLBean();
BeanUtils.copyProperties(model, bean);
return bean;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment