330 lines
7.9 KiB
Plaintext
Executable File
330 lines
7.9 KiB
Plaintext
Executable File
package com.fp.persistence.parmas.fun;
|
|
|
|
import javax.persistence.Entity;
|
|
import java.sql.Timestamp;
|
|
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 java.lang.reflect.Field;
|
|
import javax.persistence.Transient;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMCARGA*/
|
|
@Entity(name="TarmCarga")
|
|
@Table(name="TARMCARGA")
|
|
public class TarmCarga extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable{
|
|
/**
|
|
* 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 TarmCarga
|
|
*/
|
|
@Id
|
|
@Column(name="CCARGA" ,nullable=false, updatable=false)
|
|
private String pk;
|
|
@Column(name="PROVINCECODE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String provincecode;
|
|
|
|
@Column(name="CITYCODE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String citycode;
|
|
|
|
@Column(name="AUCP", nullable=true)
|
|
|
|
/**
|
|
* NUMERO DE SOLICITUD DE IMPORTACION VUE
|
|
*/
|
|
private String aucp;
|
|
|
|
@Column(name="CANTONCODE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String cantoncode;
|
|
|
|
@Column(name="PERSONCODE", nullable=false)
|
|
|
|
/**
|
|
* Codigo de persona
|
|
*/
|
|
private Integer personcode;
|
|
|
|
@Column(name="ESDESADUANIZADO", nullable=false)
|
|
|
|
/**
|
|
* CAMPO PARA INDICAR SI UNA IMPORTACION FUE DESADUANIDA
|
|
*/
|
|
private String esdesaduanizado;
|
|
|
|
@Column(name="TIPOCARGA", nullable=false)
|
|
|
|
/**
|
|
* INDICA SI LA CARGA ES UNA IMPORTACION, PRODUCCION O INVENTARIO
|
|
*/
|
|
private String tipocarga;
|
|
|
|
@Column(name="CREGISTRO", nullable=false)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Long cregistro;
|
|
|
|
@Column(name="FECHA", nullable=false)
|
|
|
|
/**
|
|
* FECHA DE LA CARGA
|
|
*/
|
|
private Timestamp fecha;
|
|
|
|
@Column(name="CSOLICITUD", nullable=true)
|
|
|
|
/**
|
|
* Codigo de solicitud previa importacion a la que esta atada la carga
|
|
*/
|
|
private String csolicitud;
|
|
|
|
@Column(name="CATEGORIA", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String categoria;
|
|
|
|
/**Contructor por defecto*/
|
|
public TarmCarga(){
|
|
}
|
|
/**Contructor de TarmCarga
|
|
@param pPk Clave Primaria del entity
|
|
@param pPersoncode Codigo de persona
|
|
@param pEsdesaduanizado CAMPO PARA INDICAR SI UNA IMPORTACION FUE DESADUANIDA
|
|
@param pTipocarga INDICA SI LA CARGA ES UNA IMPORTACION, PRODUCCION O INVENTARIO
|
|
@param pCregistro null
|
|
@param pFecha FECHA DE LA CARGA
|
|
*/
|
|
public TarmCarga(String pPk,Integer pPersoncode,String pEsdesaduanizado,String pTipocarga,Long pCregistro,Timestamp pFecha){
|
|
this();
|
|
pk=pPk;
|
|
personcode=pPersoncode;
|
|
esdesaduanizado=pEsdesaduanizado;
|
|
tipocarga=pTipocarga;
|
|
cregistro=pCregistro;
|
|
fecha=pFecha;
|
|
}
|
|
/**
|
|
* 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 TarmCarga
|
|
*/
|
|
public static TarmCarga find(EntityManager pEntityManager,Object pKey) throws Exception{
|
|
TarmCarga obj = pEntityManager.find(TarmCarga.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TarmCarga
|
|
@return El objeto que referencia a la Clave primaria de TarmCarga
|
|
*/
|
|
public String getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TarmCarga
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TarmCarga
|
|
*/
|
|
public void setPk(String pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de provincecode
|
|
@return valor de provincecode*/
|
|
public String getProvincecode(){
|
|
return provincecode;
|
|
}
|
|
/**Fija el valor de provincecode
|
|
@param pProvincecode nuevo Valor de provincecode*/
|
|
public void setProvincecode(String pProvincecode){
|
|
provincecode=pProvincecode;
|
|
}
|
|
|
|
/**Obtiene el valor de citycode
|
|
@return valor de citycode*/
|
|
public String getCitycode(){
|
|
return citycode;
|
|
}
|
|
/**Fija el valor de citycode
|
|
@param pCitycode nuevo Valor de citycode*/
|
|
public void setCitycode(String pCitycode){
|
|
citycode=pCitycode;
|
|
}
|
|
|
|
/**Obtiene el valor de aucp
|
|
@return valor de aucp*/
|
|
public String getAucp(){
|
|
return aucp;
|
|
}
|
|
/**Fija el valor de aucp
|
|
@param pAucp nuevo Valor de aucp*/
|
|
public void setAucp(String pAucp){
|
|
aucp=pAucp;
|
|
}
|
|
|
|
/**Obtiene el valor de cantoncode
|
|
@return valor de cantoncode*/
|
|
public String getCantoncode(){
|
|
return cantoncode;
|
|
}
|
|
/**Fija el valor de cantoncode
|
|
@param pCantoncode nuevo Valor de cantoncode*/
|
|
public void setCantoncode(String pCantoncode){
|
|
cantoncode=pCantoncode;
|
|
}
|
|
|
|
/**Obtiene el valor de personcode
|
|
@return valor de personcode*/
|
|
public Integer getPersoncode(){
|
|
return personcode;
|
|
}
|
|
/**Fija el valor de personcode
|
|
@param pPersoncode nuevo Valor de personcode*/
|
|
public void setPersoncode(Integer pPersoncode){
|
|
personcode=pPersoncode;
|
|
}
|
|
|
|
/**Obtiene el valor de esdesaduanizado
|
|
@return valor de esdesaduanizado*/
|
|
public String getEsdesaduanizado(){
|
|
return esdesaduanizado;
|
|
}
|
|
/**Fija el valor de esdesaduanizado
|
|
@param pEsdesaduanizado nuevo Valor de esdesaduanizado*/
|
|
public void setEsdesaduanizado(String pEsdesaduanizado){
|
|
esdesaduanizado=pEsdesaduanizado;
|
|
}
|
|
|
|
/**Obtiene el valor de tipocarga
|
|
@return valor de tipocarga*/
|
|
public String getTipocarga(){
|
|
return tipocarga;
|
|
}
|
|
/**Fija el valor de tipocarga
|
|
@param pTipocarga nuevo Valor de tipocarga*/
|
|
public void setTipocarga(String pTipocarga){
|
|
tipocarga=pTipocarga;
|
|
}
|
|
|
|
/**Obtiene el valor de cregistro
|
|
@return valor de cregistro*/
|
|
public Long getCregistro(){
|
|
return cregistro;
|
|
}
|
|
/**Fija el valor de cregistro
|
|
@param pCregistro nuevo Valor de cregistro*/
|
|
public void setCregistro(Long pCregistro){
|
|
cregistro=pCregistro;
|
|
}
|
|
|
|
/**Obtiene el valor de fecha
|
|
@return valor de fecha*/
|
|
public Timestamp getFecha(){
|
|
return fecha;
|
|
}
|
|
/**Fija el valor de fecha
|
|
@param pFecha nuevo Valor de fecha*/
|
|
public void setFecha(Timestamp pFecha){
|
|
fecha=pFecha;
|
|
}
|
|
|
|
/**Obtiene el valor de csolicitud
|
|
@return valor de csolicitud*/
|
|
public String getCsolicitud(){
|
|
return csolicitud;
|
|
}
|
|
/**Fija el valor de csolicitud
|
|
@param pCsolicitud nuevo Valor de csolicitud*/
|
|
public void setCsolicitud(String pCsolicitud){
|
|
csolicitud=pCsolicitud;
|
|
}
|
|
|
|
/**Obtiene el valor de categoria
|
|
@return valor de categoria*/
|
|
public String getCategoria(){
|
|
return categoria;
|
|
}
|
|
/**Fija el valor de categoria
|
|
@param pCategoria nuevo Valor de categoria*/
|
|
public void setCategoria(String pCategoria){
|
|
categoria=pCategoria;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TarmCarga))return false;
|
|
TarmCarga that = (TarmCarga) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TarmCarga
|
|
@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 TarmCarga
|
|
*/
|
|
public Object createInstance(){
|
|
TarmCarga instance=new TarmCarga();
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TarmCarga
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TarmCarga p=(TarmCarga)this.clone();
|
|
return p;
|
|
}
|
|
}
|