203 lines
5.6 KiB
Plaintext
Executable File
203 lines
5.6 KiB
Plaintext
Executable File
package com.fp.persistence.parmas.param;
|
|
|
|
import javax.persistence.Entity;
|
|
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 javax.persistence.Version;
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
import javax.persistence.Transient;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Parameter;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMCENCONTROLJUR*/
|
|
@Entity(name="TarmCentroControlJur")
|
|
@Table(name="TARMCENCONTROLJUR")
|
|
public class TarmCentroControlJur 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 TarmCentroControlJur
|
|
*/
|
|
@Id
|
|
@Column(name="CJURISDICCION" ,nullable=false, updatable=false)
|
|
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SequenceKey", parameters = {
|
|
@Parameter(name = "name", value = "CJURISDICCION"),//campo secuencial de la tabla
|
|
@Parameter(name = "type", value = "java.lang.Long"),// tipo de dato
|
|
@Parameter(name = "fill", value = "0"),
|
|
@Parameter(name = "length", value = "16")})
|
|
@GeneratedValue(generator = "seq_id")
|
|
private Long pk;
|
|
@Column(name="CCENTROCONTROL", nullable=true)
|
|
|
|
/**
|
|
* Codigo de centro de control de armas
|
|
*/
|
|
private String ccentrocontrol;
|
|
|
|
@Column(name="COUNTRYCODE", nullable=true)
|
|
|
|
/**
|
|
* Codigo de pais
|
|
*/
|
|
private String countrycode;
|
|
|
|
@Column(name="PROVINCECODE", nullable=true)
|
|
|
|
/**
|
|
* Codigo de provincia
|
|
*/
|
|
private String provincecode;
|
|
|
|
@Transient
|
|
private String provincianombre;
|
|
|
|
/**Contructor por defecto*/
|
|
public TarmCentroControlJur(){
|
|
}
|
|
/**Contructor de TarmCentroControlJur
|
|
@param pPk Clave Primaria del entity
|
|
*/
|
|
public TarmCentroControlJur(Long 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 TarmCentroControlJur
|
|
*/
|
|
public static TarmCentroControlJur find(EntityManager pEntityManager,Object pKey) throws Exception{
|
|
TarmCentroControlJur obj = pEntityManager.find(TarmCentroControlJur.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TarmCentroControlJur
|
|
@return El objeto que referencia a la Clave primaria de TarmCentroControlJur
|
|
*/
|
|
public Long getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TarmCentroControlJur
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TarmCentroControlJur
|
|
*/
|
|
public void setPk(Long pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de ccentrocontrol
|
|
@return valor de ccentrocontrol*/
|
|
public String getCcentrocontrol(){
|
|
return ccentrocontrol;
|
|
}
|
|
/**Fija el valor de ccentrocontrol
|
|
@param pCcentrocontrol nuevo Valor de ccentrocontrol*/
|
|
public void setCcentrocontrol(String pCcentrocontrol){
|
|
ccentrocontrol=pCcentrocontrol;
|
|
}
|
|
|
|
/**Obtiene el valor de countrycode
|
|
@return valor de countrycode*/
|
|
public String getCountrycode(){
|
|
return countrycode;
|
|
}
|
|
/**Fija el valor de countrycode
|
|
@param pCountrycode nuevo Valor de countrycode*/
|
|
public void setCountrycode(String pCountrycode){
|
|
countrycode=pCountrycode;
|
|
}
|
|
|
|
/**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;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TarmCentroControlJur))return false;
|
|
TarmCentroControlJur that = (TarmCentroControlJur) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TarmCentroControlJur
|
|
@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 TarmCentroControlJur
|
|
*/
|
|
public Object createInstance(){
|
|
TarmCentroControlJur instance=new TarmCentroControlJur();
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TarmCentroControlJur
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TarmCentroControlJur p=(TarmCentroControlJur)this.clone();
|
|
return p;
|
|
}
|
|
public String getProvincianombre() {
|
|
return provincianombre;
|
|
}
|
|
public void setProvincianombre(String provincianombre) {
|
|
this.provincianombre = provincianombre;
|
|
}
|
|
|
|
}
|