394 lines
8.7 KiB
Plaintext
Executable File
394 lines
8.7 KiB
Plaintext
Executable File
package com.fp.persistence.parmas.soli;
|
|
|
|
import javax.persistence.EmbeddedId;
|
|
import javax.persistence.Entity;
|
|
import java.sql.Timestamp;
|
|
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;
|
|
import java.sql.Date;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMCERTIFICADOARMAS*/
|
|
@Entity(name="TarmCertificadoArmas")
|
|
@Table(name="TARMCERTIFICADOARMAS")
|
|
public class TarmCertificadoArmas 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 TarmCertificadoArmas
|
|
*/
|
|
@EmbeddedId
|
|
private TarmCertificadoArmasKey pk;
|
|
@Column(name="LOTE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String lote;
|
|
|
|
@Column(name="PAISFABRICACION", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String paisfabricacion;
|
|
|
|
@Column(name="NAME", nullable=false)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String name;
|
|
|
|
@Column(name="CLASE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String clase;
|
|
|
|
@Column(name="ESTADO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String estado;
|
|
|
|
@Column(name="CALIBRE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String calibre;
|
|
|
|
@Column(name="TIPOARMAEXPLOSIVO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String tipoarmaexplosivo;
|
|
|
|
@Column(name="MARCA", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String marca;
|
|
|
|
@Column(name="REGISTERDATE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Date registerdate;
|
|
|
|
@Column(name="USERCODE", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String usercode;
|
|
@Column(name="TICKET", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Integer ticket;
|
|
|
|
@Column(name="IDENTIFICATION", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String identification;
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name="PERMISO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private String permiso;
|
|
|
|
@Column(name="FECHAEMISON", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Date fechaemison;
|
|
|
|
@Column(name="FECHAEXPIRACION", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Date fechaexpiracion;
|
|
|
|
/**Contructor por defecto*/
|
|
public TarmCertificadoArmas(){
|
|
}
|
|
/**Contructor de TarmCertificadoArmas
|
|
@param pPk Clave Primaria del entity
|
|
@param pName null
|
|
*/
|
|
public TarmCertificadoArmas(TarmCertificadoArmasKey pPk,String pName){
|
|
this();
|
|
pk=pPk;
|
|
name=pName;
|
|
}
|
|
/**
|
|
* 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 TarmCertificadoArmas
|
|
*/
|
|
public static TarmCertificadoArmas find(EntityManager pEntityManager,TarmCertificadoArmasKey pKey) throws Exception{
|
|
TarmCertificadoArmas obj = pEntityManager.find(TarmCertificadoArmas.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TarmCertificadoArmas
|
|
@return El objeto que referencia a la Clave primaria de TarmCertificadoArmas
|
|
*/
|
|
public TarmCertificadoArmasKey getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TarmCertificadoArmas
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TarmCertificadoArmas
|
|
*/
|
|
public void setPk(TarmCertificadoArmasKey pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de lote
|
|
@return valor de lote*/
|
|
public String getLote(){
|
|
return lote;
|
|
}
|
|
/**Fija el valor de lote
|
|
@param pLote nuevo Valor de lote*/
|
|
public void setLote(String pLote){
|
|
lote=pLote;
|
|
}
|
|
|
|
/**Obtiene el valor de paisfabricacion
|
|
@return valor de paisfabricacion*/
|
|
public String getPaisfabricacion(){
|
|
return paisfabricacion;
|
|
}
|
|
/**Fija el valor de paisfabricacion
|
|
@param pPaisfabricacion nuevo Valor de paisfabricacion*/
|
|
public void setPaisfabricacion(String pPaisfabricacion){
|
|
paisfabricacion=pPaisfabricacion;
|
|
}
|
|
|
|
/**Obtiene el valor de name
|
|
@return valor de name*/
|
|
public String getName(){
|
|
return name;
|
|
}
|
|
/**Fija el valor de name
|
|
@param pName nuevo Valor de name*/
|
|
public void setName(String pName){
|
|
name=pName;
|
|
}
|
|
|
|
/**Obtiene el valor de clase
|
|
@return valor de clase*/
|
|
public String getClase(){
|
|
return clase;
|
|
}
|
|
/**Fija el valor de clase
|
|
@param pClase nuevo Valor de clase*/
|
|
public void setClase(String pClase){
|
|
clase=pClase;
|
|
}
|
|
|
|
/**Obtiene el valor de estado
|
|
@return valor de estado*/
|
|
public String getEstado(){
|
|
return estado;
|
|
}
|
|
/**Fija el valor de estado
|
|
@param pEstado nuevo Valor de estado*/
|
|
public void setEstado(String pEstado){
|
|
estado=pEstado;
|
|
}
|
|
|
|
/**Obtiene el valor de calibre
|
|
@return valor de calibre*/
|
|
public String getCalibre(){
|
|
return calibre;
|
|
}
|
|
/**Fija el valor de calibre
|
|
@param pCalibre nuevo Valor de calibre*/
|
|
public void setCalibre(String pCalibre){
|
|
calibre=pCalibre;
|
|
}
|
|
|
|
/**Obtiene el valor de tipoarmaexplosivo
|
|
@return valor de tipoarmaexplosivo*/
|
|
public String getTipoarmaexplosivo(){
|
|
return tipoarmaexplosivo;
|
|
}
|
|
/**Fija el valor de tipoarmaexplosivo
|
|
@param pTipoarmaexplosivo nuevo Valor de tipoarmaexplosivo*/
|
|
public void setTipoarmaexplosivo(String pTipoarmaexplosivo){
|
|
tipoarmaexplosivo=pTipoarmaexplosivo;
|
|
}
|
|
|
|
/**Obtiene el valor de marca
|
|
@return valor de marca*/
|
|
public String getMarca(){
|
|
return marca;
|
|
}
|
|
/**Fija el valor de marca
|
|
@param pMarca nuevo Valor de marca*/
|
|
public void setMarca(String pMarca){
|
|
marca=pMarca;
|
|
}
|
|
|
|
/**Obtiene el valor de registerdate
|
|
@return valor de registerdate*/
|
|
public Date getRegisterdate(){
|
|
return registerdate;
|
|
}
|
|
/**Fija el valor de registerdate
|
|
@param pRegisterdate nuevo Valor de registerdate*/
|
|
public void setRegisterdate(Date pRegisterdate){
|
|
registerdate=pRegisterdate;
|
|
}
|
|
|
|
/**Obtiene el valor de identification
|
|
@return valor de identification*/
|
|
public String getIdentification(){
|
|
return identification;
|
|
}
|
|
/**Fija el valor de identification
|
|
@param pIdentification nuevo Valor de identification*/
|
|
public void setIdentification(String pIdentification){
|
|
identification=pIdentification;
|
|
}
|
|
|
|
public String getUsercode() {
|
|
return usercode;
|
|
}
|
|
public void setUsercode(String usercode) {
|
|
this.usercode = usercode;
|
|
}
|
|
|
|
public Integer getTicket() {
|
|
return ticket;
|
|
}
|
|
public void setTicket(Integer ticket) {
|
|
this.ticket = ticket;
|
|
}
|
|
/**
|
|
* @return the permiso
|
|
*/
|
|
public String getPermiso() {
|
|
return permiso;
|
|
}
|
|
/**
|
|
* @param permiso the permiso to set
|
|
*/
|
|
public void setPermiso(String permiso) {
|
|
this.permiso = permiso;
|
|
}
|
|
/**
|
|
* @return the fechaemison
|
|
*/
|
|
public Date getFechaemison() {
|
|
return fechaemison;
|
|
}
|
|
/**
|
|
* @param fechaemison the fechaemison to set
|
|
*/
|
|
public void setFechaemison(Date fechaemison) {
|
|
this.fechaemison = fechaemison;
|
|
}
|
|
/**
|
|
* @return the fechaexpiracion
|
|
*/
|
|
public Date getFechaexpiracion() {
|
|
return fechaexpiracion;
|
|
}
|
|
/**
|
|
* @param fechaexpiracion the fechaexpiracion to set
|
|
*/
|
|
public void setFechaexpiracion(Date fechaexpiracion) {
|
|
this.fechaexpiracion = fechaexpiracion;
|
|
}
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TarmCertificadoArmas))return false;
|
|
TarmCertificadoArmas that = (TarmCertificadoArmas) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TarmCertificadoArmas
|
|
@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 TarmCertificadoArmas
|
|
*/
|
|
public Object createInstance(){
|
|
TarmCertificadoArmas instance=new TarmCertificadoArmas();
|
|
instance.setPk(new TarmCertificadoArmasKey());
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TarmCertificadoArmas
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TarmCertificadoArmas p=(TarmCertificadoArmas)this.clone();
|
|
p.setPk((TarmCertificadoArmasKey)this.pk.cloneMe());
|
|
return p;
|
|
}
|
|
|
|
}
|