250 lines
6.9 KiB
Plaintext
Executable File
250 lines
6.9 KiB
Plaintext
Executable File
package com.fp.persistence.parmas.inte;
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
import java.sql.Timestamp;
|
|
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Id;
|
|
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 java.lang.reflect.Field;
|
|
|
|
import javax.persistence.Transient;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Parameter;
|
|
|
|
import java.sql.Date;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMCOLADEIMPRESION*/
|
|
@Entity(name="TarmColadeImpresion")
|
|
@Table(name="TARMCOLADEIMPRESION")
|
|
public class TarmColadeImpresion 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 TarmColadeImpresion
|
|
*/
|
|
@Id
|
|
@Column(name="CIMPRESION" ,nullable=false, updatable=false)
|
|
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SequenceKey", parameters = {
|
|
@Parameter(name = "name", value = "TARMCOLADEIMPRESION"),//campo secuencial de la tabla
|
|
@Parameter(name = "type", value = "java.lang.String"),// tipo de dato
|
|
@Parameter(name = "fill", value = "0"),
|
|
@Parameter(name = "length", value = "10")})
|
|
@GeneratedValue(generator = "seq_id")
|
|
private String pk;
|
|
@Column(name="ESTADOIMPRESION", nullable=true)
|
|
|
|
/**
|
|
* Codigo de catalogo 01 Por Imprimir, 02 Impreso
|
|
*/
|
|
private String estadoimpresion;
|
|
|
|
@Column(name="FECHAIMPRESION", nullable=true)
|
|
|
|
/**
|
|
* Fecha de Impresion del Documento
|
|
*/
|
|
private Timestamp fechaimpresion;
|
|
|
|
@Column(name="ESTADOIMPRESIONCODE", nullable=true)
|
|
|
|
/**
|
|
* Codigo de tabla de catalogo 01 Codigo de tabla de tipos de persona
|
|
*/
|
|
private String estadoimpresioncode;
|
|
|
|
@Column(name="CDOCUMENTO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Long cdocumento;
|
|
|
|
@Column(name="FECHAREGISTRO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Date fecharegistro;
|
|
|
|
@Column(name="CODIGOTARJETA", nullable=true)
|
|
|
|
/**
|
|
* Codigo interno de la tarjeta fisica
|
|
*/
|
|
private String codigotarjeta;
|
|
|
|
/**Contructor por defecto*/
|
|
public TarmColadeImpresion(){
|
|
}
|
|
/**Contructor de TarmColadeImpresion
|
|
@param pPk Clave Primaria del entity
|
|
*/
|
|
public TarmColadeImpresion(String pPk){
|
|
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 TarmColadeImpresion
|
|
*/
|
|
public static TarmColadeImpresion find(EntityManager pEntityManager,Object pKey) throws Exception{
|
|
TarmColadeImpresion obj = pEntityManager.find(TarmColadeImpresion.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TarmColadeImpresion
|
|
@return El objeto que referencia a la Clave primaria de TarmColadeImpresion
|
|
*/
|
|
public String getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TarmColadeImpresion
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TarmColadeImpresion
|
|
*/
|
|
public void setPk(String pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de estadoimpresion
|
|
@return valor de estadoimpresion*/
|
|
public String getEstadoimpresion(){
|
|
return estadoimpresion;
|
|
}
|
|
/**Fija el valor de estadoimpresion
|
|
@param pEstadoimpresion nuevo Valor de estadoimpresion*/
|
|
public void setEstadoimpresion(String pEstadoimpresion){
|
|
estadoimpresion=pEstadoimpresion;
|
|
}
|
|
|
|
/**Obtiene el valor de fechaimpresion
|
|
@return valor de fechaimpresion*/
|
|
public Timestamp getFechaimpresion(){
|
|
return fechaimpresion;
|
|
}
|
|
/**Fija el valor de fechaimpresion
|
|
@param pFechaimpresion nuevo Valor de fechaimpresion*/
|
|
public void setFechaimpresion(Timestamp pFechaimpresion){
|
|
fechaimpresion=pFechaimpresion;
|
|
}
|
|
|
|
/**Obtiene el valor de estadoimpresioncode
|
|
@return valor de estadoimpresioncode*/
|
|
public String getEstadoimpresioncode(){
|
|
return estadoimpresioncode;
|
|
}
|
|
/**Fija el valor de estadoimpresioncode
|
|
@param pEstadoimpresioncode nuevo Valor de estadoimpresioncode*/
|
|
public void setEstadoimpresioncode(String pEstadoimpresioncode){
|
|
estadoimpresioncode=pEstadoimpresioncode;
|
|
}
|
|
|
|
/**Obtiene el valor de cdocumento
|
|
@return valor de cdocumento*/
|
|
public Long getCdocumento(){
|
|
return cdocumento;
|
|
}
|
|
/**Fija el valor de cdocumento
|
|
@param pCdocumento nuevo Valor de cdocumento*/
|
|
public void setCdocumento(Long pCdocumento){
|
|
cdocumento=pCdocumento;
|
|
}
|
|
|
|
/**Obtiene el valor de fecharegistro
|
|
@return valor de fecharegistro*/
|
|
public Date getFecharegistro(){
|
|
return fecharegistro;
|
|
}
|
|
/**Fija el valor de fecharegistro
|
|
@param pFecharegistro nuevo Valor de fecharegistro*/
|
|
public void setFecharegistro(Date pFecharegistro){
|
|
fecharegistro=pFecharegistro;
|
|
}
|
|
|
|
/**Obtiene el valor de codigotarjeta
|
|
@return valor de codigotarjeta*/
|
|
public String getCodigotarjeta(){
|
|
return codigotarjeta;
|
|
}
|
|
/**Fija el valor de codigotarjeta
|
|
@param pCodigotarjeta nuevo Valor de codigotarjeta*/
|
|
public void setCodigotarjeta(String pCodigotarjeta){
|
|
codigotarjeta=pCodigotarjeta;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TarmColadeImpresion))return false;
|
|
TarmColadeImpresion that = (TarmColadeImpresion) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TarmColadeImpresion
|
|
@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;
|
|
}
|
|
/**Implementacion 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;
|
|
}
|
|
/**Implementacion de la creacion de un bean en blanco TarmColadeImpresion
|
|
*/
|
|
public Object createInstance(){
|
|
TarmColadeImpresion instance=new TarmColadeImpresion();
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TarmColadeImpresion
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TarmColadeImpresion p=(TarmColadeImpresion)this.clone();
|
|
return p;
|
|
}
|
|
}
|