509 lines
13 KiB
Plaintext
Executable File
509 lines
13 KiB
Plaintext
Executable File
package com.fp.persistence.pcustomer.people;
|
||
|
||
import java.io.Serializable;
|
||
import java.lang.reflect.Field;
|
||
import java.sql.Date;
|
||
import java.sql.Timestamp;
|
||
|
||
import javax.persistence.Column;
|
||
import javax.persistence.EmbeddedId;
|
||
import javax.persistence.Entity;
|
||
import javax.persistence.EntityManager;
|
||
import javax.persistence.GeneratedValue;
|
||
import javax.persistence.Table;
|
||
import javax.persistence.Transient;
|
||
import javax.persistence.Version;
|
||
|
||
import org.hibernate.annotations.GenericGenerator;
|
||
import org.hibernate.annotations.Parameter;
|
||
|
||
import com.fp.dto.hb.HibernateBean;
|
||
import com.fp.dto.hb.Log;
|
||
|
||
/**
|
||
* Clase que implementa la entidad de Hibernate que hace referencia a la tabla
|
||
* TCUSTPEOPLEJOB
|
||
*/
|
||
@Entity(name = "TcustPeopleJob")
|
||
@Table(name = "TCUSTPEOPLEJOB")
|
||
public class TcustPeopleJob extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable, Log {
|
||
|
||
/**
|
||
* HashCode asociado con la Instancia
|
||
*/
|
||
@Transient
|
||
private int hashValue = 0;
|
||
/**
|
||
* Version de la Clase
|
||
*/
|
||
private static final long serialVersionUID = 1L;
|
||
/**
|
||
* Clave primaria de la Entidad TcustPeopleJob
|
||
*/
|
||
@EmbeddedId
|
||
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SubSequenceKey", parameters = {
|
||
@Parameter(name = "sql", value = "select coalesce(max(JOBSEQUENCE),0)+1 from TCUSTPEOPLEJOB where personcode=:code"),
|
||
@Parameter(name = "type", value = "java.lang.Integer"),
|
||
@Parameter(name = "param", value = "code,pk.personcode"),
|
||
@Parameter(name = "field", value = "jobsequence")})
|
||
@GeneratedValue(generator = "seq_id")
|
||
private TcustPeopleJobKey pk;
|
||
@Column(name = "DATEFROM", nullable = true)
|
||
/**
|
||
* Fecha desde la cual esta vigente el registro
|
||
*/
|
||
private Timestamp datefrom;
|
||
@Version
|
||
@Column(name = "RECORDVERSION", nullable = true)
|
||
/**
|
||
* Optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
@Column(name = "EMPLOYERPERSONCODE", nullable = true)
|
||
/**
|
||
* Codigo de persona empleadora
|
||
*/
|
||
private Integer employerpersoncode;
|
||
@Column(name = "JOBCATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo 1, Gerente, 2 Chofer, 3 Cajero
|
||
*/
|
||
private String jobcatalog;
|
||
@Column(name = "JOBCATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo de cargos de personas naturales JOB
|
||
*/
|
||
private String jobcatalogcode;
|
||
@Column(name = "AGREEMENTTYPECATALOG", nullable = true)
|
||
/**
|
||
* Codigo de contrato, 1 indefinido, 2 un a<>o , 3 tres meses etc.
|
||
*/
|
||
private String agreementtypecatalog;
|
||
@Column(name = "AGREEMENTTYPECATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo AGREEMENTTYPE tipo de contrato
|
||
*/
|
||
private String agreementtypecatalogcode;
|
||
@Column(name = "ENTRYDATE", nullable = true)
|
||
/**
|
||
* Fecha de ingreso al trabajo
|
||
*/
|
||
private Date entrydate;
|
||
@Column(name = "DEPARTUREDATE", nullable = true)
|
||
/**
|
||
* Fecha de salida del trabajo
|
||
*/
|
||
private Date departuredate;
|
||
@Column(name = "EMPLOYERNAME", nullable = true)
|
||
/**
|
||
* Nombre del empleador
|
||
*/
|
||
private String employername;
|
||
@Column(name = "ISOWNER", nullable = true)
|
||
/**
|
||
* Y indica que es duenio de la empresa.
|
||
*/
|
||
private String isowner;
|
||
@Column(name = "ADDRESS", nullable = true)
|
||
/**
|
||
* Numero de direccion asociada al trabajo
|
||
*/
|
||
private Integer address;
|
||
@Column(name = "INGRESSUSERCODE", nullable = true)
|
||
/**
|
||
* Codigo de usuario
|
||
*/
|
||
private String ingressusercode;
|
||
@Column(name = "MODIFYUSERCODE", nullable = true)
|
||
/**
|
||
* Codigo de usuario
|
||
*/
|
||
private String modifyusercode;
|
||
|
||
/**
|
||
* Contructor por defecto
|
||
*/
|
||
public TcustPeopleJob() {
|
||
}
|
||
|
||
/**
|
||
* Contructor de TcustPeopleJob
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
*/
|
||
public TcustPeopleJob(TcustPeopleJobKey pPk) {
|
||
this();
|
||
this.pk = pPk;
|
||
}
|
||
|
||
/**
|
||
* Metodo que entrega datos de la tabla dada la clave primaria.
|
||
*
|
||
* @param pEntityManager referencia de la session a obtener datos del bean.
|
||
* @param pKey Caleve primaria del bean.
|
||
* @return TcustPeopleJob
|
||
*/
|
||
public static TcustPeopleJob find(EntityManager pEntityManager, TcustPeopleJobKey pKey) throws Exception {
|
||
TcustPeopleJob obj = pEntityManager.find(TcustPeopleJob.class, pKey);
|
||
return obj;
|
||
}
|
||
|
||
/**
|
||
* Entrega la Clave primaria de TcustPeopleJob
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de TcustPeopleJob
|
||
*/
|
||
public TcustPeopleJobKey getPk() {
|
||
return this.pk;
|
||
}
|
||
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TcustPeopleJob
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de
|
||
* TcustPeopleJob
|
||
*/
|
||
public void setPk(TcustPeopleJobKey pPk) {
|
||
this.pk = pPk;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de datefrom
|
||
*
|
||
* @return valor de datefrom
|
||
*/
|
||
public Timestamp getDatefrom() {
|
||
return this.datefrom;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de datefrom
|
||
*
|
||
* @param pDatefrom nuevo Valor de datefrom
|
||
*/
|
||
public void setDatefrom(Timestamp pDatefrom) {
|
||
this.datefrom = pDatefrom;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de recordversion
|
||
*
|
||
* @return valor de recordversion
|
||
*/
|
||
public Integer getRecordversion() {
|
||
return this.recordversion;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de recordversion
|
||
*
|
||
* @param pRecordversion nuevo Valor de recordversion
|
||
*/
|
||
public void setRecordversion(Integer pRecordversion) {
|
||
this.recordversion = pRecordversion;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de employerpersoncode
|
||
*
|
||
* @return valor de employerpersoncode
|
||
*/
|
||
public Integer getEmployerpersoncode() {
|
||
return this.employerpersoncode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de employerpersoncode
|
||
*
|
||
* @param pEmployerpersoncode nuevo Valor de employerpersoncode
|
||
*/
|
||
public void setEmployerpersoncode(Integer pEmployerpersoncode) {
|
||
this.employerpersoncode = pEmployerpersoncode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de jobcatalog
|
||
*
|
||
* @return valor de jobcatalog
|
||
*/
|
||
public String getJobcatalog() {
|
||
return this.jobcatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de jobcatalog
|
||
*
|
||
* @param pJobcatalog nuevo Valor de jobcatalog
|
||
*/
|
||
public void setJobcatalog(String pJobcatalog) {
|
||
this.jobcatalog = pJobcatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de jobcatalogcode
|
||
*
|
||
* @return valor de jobcatalogcode
|
||
*/
|
||
public String getJobcatalogcode() {
|
||
return this.jobcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de jobcatalogcode
|
||
*
|
||
* @param pJobcatalogcode nuevo Valor de jobcatalogcode
|
||
*/
|
||
public void setJobcatalogcode(String pJobcatalogcode) {
|
||
this.jobcatalogcode = pJobcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de agreementtypecatalog
|
||
*
|
||
* @return valor de agreementtypecatalog
|
||
*/
|
||
public String getAgreementtypecatalog() {
|
||
return this.agreementtypecatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de agreementtypecatalog
|
||
*
|
||
* @param pAgreementtypecatalog nuevo Valor de agreementtypecatalog
|
||
*/
|
||
public void setAgreementtypecatalog(String pAgreementtypecatalog) {
|
||
this.agreementtypecatalog = pAgreementtypecatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de agreementtypecatalogcode
|
||
*
|
||
* @return valor de agreementtypecatalogcode
|
||
*/
|
||
public String getAgreementtypecatalogcode() {
|
||
return this.agreementtypecatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de agreementtypecatalogcode
|
||
*
|
||
* @param pAgreementtypecatalogcode nuevo Valor de agreementtypecatalogcode
|
||
*/
|
||
public void setAgreementtypecatalogcode(String pAgreementtypecatalogcode) {
|
||
this.agreementtypecatalogcode = pAgreementtypecatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de entrydate
|
||
*
|
||
* @return valor de entrydate
|
||
*/
|
||
public Date getEntrydate() {
|
||
return this.entrydate;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de entrydate
|
||
*
|
||
* @param pEntrydate nuevo Valor de entrydate
|
||
*/
|
||
public void setEntrydate(Date pEntrydate) {
|
||
this.entrydate = pEntrydate;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de departuredate
|
||
*
|
||
* @return valor de departuredate
|
||
*/
|
||
public Date getDeparturedate() {
|
||
return this.departuredate;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de departuredate
|
||
*
|
||
* @param pDeparturedate nuevo Valor de departuredate
|
||
*/
|
||
public void setDeparturedate(Date pDeparturedate) {
|
||
this.departuredate = pDeparturedate;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de employername
|
||
*
|
||
* @return valor de employername
|
||
*/
|
||
public String getEmployername() {
|
||
return this.employername;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de employername
|
||
*
|
||
* @param pEmployername nuevo Valor de employername
|
||
*/
|
||
public void setEmployername(String pEmployername) {
|
||
this.employername = pEmployername;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de isowner
|
||
*
|
||
* @return valor de isowner
|
||
*/
|
||
public String getIsowner() {
|
||
return this.isowner;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de isowner
|
||
*
|
||
* @param pIsowner nuevo Valor de isowner
|
||
*/
|
||
public void setIsowner(String pIsowner) {
|
||
this.isowner = pIsowner;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de address
|
||
*
|
||
* @return valor de address
|
||
*/
|
||
public Integer getAddress() {
|
||
return this.address;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de address
|
||
*
|
||
* @param pAddress nuevo Valor de address
|
||
*/
|
||
public void setAddress(Integer pAddress) {
|
||
this.address = pAddress;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de ingressusercode
|
||
*
|
||
* @return valor de ingressusercode
|
||
*/
|
||
public String getIngressusercode() {
|
||
return this.ingressusercode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de ingressusercode
|
||
*
|
||
* @param pIngressusercode nuevo Valor de ingressusercode
|
||
*/
|
||
public void setIngressusercode(String pIngressusercode) {
|
||
this.ingressusercode = pIngressusercode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de modifyusercode
|
||
*
|
||
* @return valor de modifyusercode
|
||
*/
|
||
public String getModifyusercode() {
|
||
return this.modifyusercode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de modifyusercode
|
||
*
|
||
* @param pModifyusercode nuevo Valor de modifyusercode
|
||
*/
|
||
public void setModifyusercode(String pModifyusercode) {
|
||
this.modifyusercode = pModifyusercode;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object rhs) {
|
||
if (rhs == null) {
|
||
return false;
|
||
}
|
||
if (!(rhs instanceof TcustPeopleJob)) {
|
||
return false;
|
||
}
|
||
TcustPeopleJob that = (TcustPeopleJob) rhs;
|
||
if ((this.getPk() == null) || (that.getPk() == null)) {
|
||
return false;
|
||
}
|
||
return (this.getPk().equals(that.getPk()));
|
||
}
|
||
|
||
/**
|
||
* Implementaci<63>n del metodo hashCode de la la entidad TcustPeopleJob
|
||
*
|
||
* @return el hashCode la instancia
|
||
*/
|
||
@Override
|
||
public int hashCode() {
|
||
if (this.hashValue == 0) {
|
||
int result = 17;
|
||
if (this.getPk() == null) {
|
||
result = super.hashCode();
|
||
} else {
|
||
result = this.getPk().hashCode();
|
||
}
|
||
this.hashValue = result;
|
||
}
|
||
return this.hashValue;
|
||
}
|
||
|
||
/**
|
||
* Implementaci<63>n toString
|
||
*/
|
||
@Override
|
||
public String toString() {
|
||
Field[] fs = this.getClass().getDeclaredFields();
|
||
String data = "";
|
||
for (Field f : fs) {
|
||
try {
|
||
String name = f.getName();
|
||
if (f.getType().getName().compareTo("java.util.Set") == 0) {
|
||
continue;
|
||
}
|
||
if ((name.compareTo("hashValue") == 0) || (name.compareTo("serialVersionUID") == 0)) {
|
||
continue;
|
||
}
|
||
data += name + "=" + f.get(this) + ";";
|
||
} catch (Exception e) {
|
||
continue;
|
||
}
|
||
}
|
||
if (data.compareTo("") == 0) {
|
||
data = super.toString();
|
||
}
|
||
return data;
|
||
}
|
||
|
||
/**
|
||
* Implementaci<63>n de la creaci<63>n de un bean en blanco TcustPeopleJob
|
||
*/
|
||
@Override
|
||
public Object createInstance() {
|
||
TcustPeopleJob instance = new TcustPeopleJob();
|
||
instance.setPk(new TcustPeopleJobKey());
|
||
return instance;
|
||
}
|
||
|
||
/**
|
||
* Clona la entidad TcustPeopleJob
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
@Override
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TcustPeopleJob p = (TcustPeopleJob) this.clone();
|
||
p.setPk((TcustPeopleJobKey) this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
public Object getId() {
|
||
return this.pk;
|
||
}
|
||
}
|