Commit 1ed2b328 authored by Roberto Loayza's avatar Roberto Loayza

ETL Process

- Creación de servicios ETL
parent a577f209
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;
}
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;
}
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