package com.fp.persistence.parmas.fun; import java.io.Serializable; import java.lang.reflect.Field; import java.sql.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EntityManager; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; import com.fp.dto.hb.HibernateBean; import com.fp.dto.hb.Log; /**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMVENTAARMATEM*/ @Entity(name="TarmVentaArmaTem") @Table(name="TARMVENTAARMATEM") public class TarmVentaArmaTem 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 TarmVentaArmaTem */ @Id @Column(name="CARMAVENTATEM" ,nullable=false, updatable=false) private Integer pk; @Column(name="CARMA", nullable=true) /** * null */ private String carma; @Column(name="FCREACION", nullable=true) /** * null */ private Date fcreacion; @Column(name="ESTADO", nullable=true) /** * null */ private String estado; @Column(name="PERSONCODIGO", nullable=true) /** * null */ private Integer personcodigo; @Column(name="FACTURA", nullable=true) private String factura; @Column(name="NOREGISTRO", nullable=true) private String noregistra; @Column(name="JUSTIFICACION", nullable=true) private String justificacion; @Column(name="OBSERVACION", nullable=true) private String observacion; @Column(name="PATHDOCUMENTO", nullable=true) private String pathdocumento; @Column(name="CENTROCONTROL", nullable=true) private String centrocontrol; /**Contructor por defecto*/ public TarmVentaArmaTem(){ } /**Contructor de TarmVentaArmaTem @param pPk Clave Primaria del entity */ public TarmVentaArmaTem(Integer 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 TarmVentaArmaTem */ public static TarmVentaArmaTem find(EntityManager pEntityManager,Object pKey) throws Exception{ TarmVentaArmaTem obj = pEntityManager.find(TarmVentaArmaTem.class,pKey); return obj; } /**Entrega la Clave primaria de TarmVentaArmaTem @return El objeto que referencia a la Clave primaria de TarmVentaArmaTem */ public Integer getPk(){ return pk; } /**Fija un nuevo valor a la Clave primaria de TarmVentaArmaTem @param pPk El objeto que referencia a la nueva Clave primaria de TarmVentaArmaTem */ public void setPk(Integer pPk){ pk=pPk; } /**Obtiene el valor de carma @return valor de carma*/ public String getCarma(){ return carma; } /**Fija el valor de carma @param pCarma nuevo Valor de carma*/ public void setCarma(String pCarma){ carma=pCarma; } /**Obtiene el valor de fcreacion @return valor de fcreacion*/ public Date getFcreacion(){ return fcreacion; } /**Fija el valor de fcreacion @param pFcreacion nuevo Valor de fcreacion*/ public void setFcreacion(Date pFcreacion){ fcreacion=pFcreacion; } /**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 personcodigo @return valor de personcodigo*/ public Integer getPersoncodigo(){ return personcodigo; } /**Fija el valor de personcodigo @param pPersoncodigo nuevo Valor de personcodigo*/ public void setPersoncodigo(Integer pPersoncodigo){ personcodigo=pPersoncodigo; } public String getFactura() { return factura; } public void setFactura(String factura) { this.factura = factura; } public String getNoregistra() { return noregistra; } public void setNoregistra(String noregistra) { this.noregistra = noregistra; } public String getJustificacion() { return justificacion; } public void setJustificacion(String justificacion) { this.justificacion = justificacion; } public String getObservacion() { return observacion; } public void setObservacion(String observacion) { this.observacion = observacion; } public String getPathdocumento() { return pathdocumento; } public void setPathdocumento(String pathdocumento) { this.pathdocumento = pathdocumento; } public String getCentrocontrol() { return centrocontrol; } public void setCentrocontrol(String centrocontrol) { this.centrocontrol = centrocontrol; } public boolean equals(Object rhs){ if (rhs == null)return false; if (! (rhs instanceof TarmVentaArmaTem))return false; TarmVentaArmaTem that = (TarmVentaArmaTem) rhs; if (this.getPk() == null || that.getPk() == null) return false; return (this.getPk().equals(that.getPk())); } /**Implementacion del metodo hashCode de la la entidad TarmVentaArmaTem @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 TarmVentaArmaTem */ public Object createInstance(){ TarmVentaArmaTem instance=new TarmVentaArmaTem(); return instance; } /**Clona la entidad TarmVentaArmaTem @see com.fp.dto.hb.HibernateBean#cloneMe() */ public Object cloneMe() throws CloneNotSupportedException{ TarmVentaArmaTem p=(TarmVentaArmaTem)this.clone(); return p; } }