338 lines
9.9 KiB
Plaintext
Executable File
338 lines
9.9 KiB
Plaintext
Executable File
package com.fp.persistence.pcustomer.company;
|
||
|
||
import javax.persistence.EmbeddedId;
|
||
import javax.persistence.Entity;
|
||
import javax.persistence.Column;
|
||
import javax.persistence.EntityManager;
|
||
import java.io.Serializable;
|
||
import javax.persistence.Table;
|
||
import com.fp.dto.hb.HibernateBean;
|
||
import com.fp.dto.hb.Log;
|
||
import javax.persistence.Version;
|
||
import java.lang.reflect.Field;
|
||
import javax.persistence.Transient;
|
||
import java.util.List;
|
||
import javax.persistence.Query;
|
||
|
||
/**
|
||
* Clase que implementa la entidad de Hibernate que hace referencia a la tabla
|
||
* TCUSTFAMILIARLLINK
|
||
*/
|
||
@Entity(name = "TcustFamiliarlLink")
|
||
@Table(name = "TCUSTFAMILIARLLINK")
|
||
public class TcustFamiliarlLink 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 TcustFamiliarlLink
|
||
*/
|
||
@EmbeddedId
|
||
private TcustFamiliarlLinkKey pk;
|
||
@Column(name = "FAMILIARLINKCATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo 1 Padre, 3 Madre, 3 Hermano/a, 4 Conyuge.
|
||
*/
|
||
private String familiarlinkcatalog;
|
||
@Column(name = "FAMILIARLINKCATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo FAMILIARLINK, vinculaciones familiares
|
||
*/
|
||
private String familiarlinkcatalogcode;
|
||
@Version
|
||
@Column(name = "RECORDVERSION", nullable = false)
|
||
/**
|
||
* Optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
@Column(name = "PROPERTYDIVISION", nullable = true)
|
||
/**
|
||
* Y Indica que existe separacion de bienes, N mop existe separacion de
|
||
* bienes
|
||
*/
|
||
private String propertydivision;
|
||
@Column(name = "INGRESSUSER", nullable = true)
|
||
/**
|
||
* Codigo de usuario que crea el cliente
|
||
*/
|
||
private String ingressuser;
|
||
@Column(name = "MODIFYUSER", nullable = true)
|
||
/**
|
||
* Codigo de usuario que modifica datos del cliente
|
||
*/
|
||
private String modifyuser;
|
||
//METODOS MANUALES
|
||
/**
|
||
* Sentencia que devuelve las excepciones de una solicitud.
|
||
*/
|
||
private static final String JPQL_SOL_TCUSTFAMILIARLINK = "from TcustFamiliarlLink tcustFamiliarLink "
|
||
+ " where tcustFamiliarLink.pk.personcode = :personcode ";
|
||
/**
|
||
*
|
||
*/
|
||
private static final String JPQL_SOL_TCUSTFAMILIARLINKPERSONCODE = "from TcustFamiliarlLink tcustFamiliarLink "
|
||
+ " where tcustFamiliarLink.pk.linkpersoncode = :personcode ";
|
||
|
||
/**
|
||
* Contructor por defecto
|
||
*/
|
||
public TcustFamiliarlLink() {
|
||
}
|
||
|
||
/**
|
||
* Contructor de TcustFamiliarlLink
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
* @param pRecordversion Optimistic locking del registro
|
||
*/
|
||
public TcustFamiliarlLink(TcustFamiliarlLinkKey pPk, Integer pRecordversion) {
|
||
this();
|
||
pk = pPk;
|
||
recordversion = pRecordversion;
|
||
}
|
||
|
||
/**
|
||
* 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 TcustFamiliarlLink
|
||
*/
|
||
public static TcustFamiliarlLink find(EntityManager pEntityManager, TcustFamiliarlLinkKey pKey) throws Exception {
|
||
TcustFamiliarlLink obj = pEntityManager.find(TcustFamiliarlLink.class, pKey);
|
||
return obj;
|
||
}
|
||
|
||
@SuppressWarnings(com.fp.common.helper.Constant.VUNCHECKED)
|
||
public static List<TcustFamiliarlLink> findByPersonCode(EntityManager pEntityManager, Integer pPersonCode) throws Exception {
|
||
List<TcustFamiliarlLink> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(TcustFamiliarlLink.JPQL_SOL_TCUSTFAMILIARLINK);
|
||
qry.setParameter("personcode", pPersonCode);
|
||
lObjects = qry.getResultList();
|
||
return lObjects;
|
||
}
|
||
|
||
@SuppressWarnings(com.fp.common.helper.Constant.VUNCHECKED)
|
||
public static List<TcustFamiliarlLink> findByPersonCodeLink(EntityManager pEntityManager, Integer pPersonCodeLink) throws Exception {
|
||
List<TcustFamiliarlLink> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(TcustFamiliarlLink.JPQL_SOL_TCUSTFAMILIARLINKPERSONCODE);
|
||
qry.setParameter("personcode", pPersonCodeLink);
|
||
lObjects = qry.getResultList();
|
||
return lObjects;
|
||
}
|
||
|
||
/**
|
||
* Entrega la Clave primaria de TcustFamiliarlLink
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de
|
||
* TcustFamiliarlLink
|
||
*/
|
||
public TcustFamiliarlLinkKey getPk() {
|
||
return pk;
|
||
}
|
||
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TcustFamiliarlLink
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de
|
||
* TcustFamiliarlLink
|
||
*/
|
||
public void setPk(TcustFamiliarlLinkKey pPk) {
|
||
pk = pPk;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de familiarlinkcatalog
|
||
*
|
||
* @return valor de familiarlinkcatalog
|
||
*/
|
||
public String getFamiliarlinkcatalog() {
|
||
return familiarlinkcatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de familiarlinkcatalog
|
||
*
|
||
* @param pFamiliarlinkcatalog nuevo Valor de familiarlinkcatalog
|
||
*/
|
||
public void setFamiliarlinkcatalog(String pFamiliarlinkcatalog) {
|
||
familiarlinkcatalog = pFamiliarlinkcatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de familiarlinkcatalogcode
|
||
*
|
||
* @return valor de familiarlinkcatalogcode
|
||
*/
|
||
public String getFamiliarlinkcatalogcode() {
|
||
return familiarlinkcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de familiarlinkcatalogcode
|
||
*
|
||
* @param pFamiliarlinkcatalogcode nuevo Valor de familiarlinkcatalogcode
|
||
*/
|
||
public void setFamiliarlinkcatalogcode(String pFamiliarlinkcatalogcode) {
|
||
familiarlinkcatalogcode = pFamiliarlinkcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de recordversion
|
||
*
|
||
* @return valor de recordversion
|
||
*/
|
||
public Integer getRecordversion() {
|
||
return recordversion;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de recordversion
|
||
*
|
||
* @param pRecordversion nuevo Valor de recordversion
|
||
*/
|
||
public void setRecordversion(Integer pRecordversion) {
|
||
recordversion = pRecordversion;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de propertydivision
|
||
*
|
||
* @return valor de propertydivision
|
||
*/
|
||
public String getPropertydivision() {
|
||
return propertydivision;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de propertydivision
|
||
*
|
||
* @param pPropertydivision nuevo Valor de propertydivision
|
||
*/
|
||
public void setPropertydivision(String pPropertydivision) {
|
||
propertydivision = pPropertydivision;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de ingressuser
|
||
*
|
||
* @return valor de ingressuser
|
||
*/
|
||
public String getIngressuser() {
|
||
return ingressuser;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de ingressuser
|
||
*
|
||
* @param pIngressuser nuevo Valor de ingressuser
|
||
*/
|
||
public void setIngressuser(String pIngressuser) {
|
||
ingressuser = pIngressuser;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de modifyuser
|
||
*
|
||
* @return valor de modifyuser
|
||
*/
|
||
public String getModifyuser() {
|
||
return modifyuser;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de modifyuser
|
||
*
|
||
* @param pModifyuser nuevo Valor de modifyuser
|
||
*/
|
||
public void setModifyuser(String pModifyuser) {
|
||
modifyuser = pModifyuser;
|
||
}
|
||
|
||
public boolean equals(Object rhs) {
|
||
if (rhs == null) {
|
||
return false;
|
||
}
|
||
if (!(rhs instanceof TcustFamiliarlLink)) {
|
||
return false;
|
||
}
|
||
TcustFamiliarlLink that = (TcustFamiliarlLink) 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 TcustFamiliarlLink
|
||
*
|
||
* @return el hashCode la instancia
|
||
*/
|
||
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
|
||
*/
|
||
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 TcustFamiliarlLink
|
||
*/
|
||
public Object createInstance() {
|
||
TcustFamiliarlLink instance = new TcustFamiliarlLink();
|
||
instance.setPk(new TcustFamiliarlLinkKey());
|
||
return instance;
|
||
}
|
||
|
||
/**
|
||
* Clona la entidad TcustFamiliarlLink
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TcustFamiliarlLink p = (TcustFamiliarlLink) this.clone();
|
||
p.setPk((TcustFamiliarlLinkKey) this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
}
|