222 lines
6.4 KiB
Plaintext
Executable File
222 lines
6.4 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.safe;
|
||
|
||
import javax.persistence.EmbeddedId;
|
||
import javax.persistence.Entity;
|
||
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;
|
||
|
||
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TSAFEPROFILEHORARY*/
|
||
@Entity(name="TsafeProfileHorary")
|
||
@Table(name="TSAFEPROFILEHORARY")
|
||
public class TsafeProfileHorary 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 TsafeProfileHorary
|
||
*/
|
||
@EmbeddedId
|
||
private TsafeProfileHoraryKey pk;
|
||
@Column(name="REGISTERCODE", nullable=false)
|
||
|
||
/**
|
||
* Codigo de registro es la suma de los campos de la llave primaria
|
||
*/
|
||
private String registercode;
|
||
|
||
@Version
|
||
@Column(name="RECORDVERSION", nullable=true)
|
||
|
||
/**
|
||
* optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
|
||
@Column(name="INITTIME", nullable=false)
|
||
|
||
/**
|
||
* Horas y minutos desde la cual es disponible la transaccion para el dia
|
||
*/
|
||
private String inittime;
|
||
|
||
@Column(name="FINISHTIME", nullable=false)
|
||
|
||
/**
|
||
* Horas y minutos hasta la cual es disponible la transaccion para el dia
|
||
*/
|
||
private String finishtime;
|
||
|
||
@Column(name="VALIDATEAMOUNT", nullable=true)
|
||
|
||
/**
|
||
* Y Indica que valida monto de la transaccion utilizada en transacciones financieras. N no valida monto.
|
||
*/
|
||
private String validateamount;
|
||
|
||
/**Contructor por defecto*/
|
||
public TsafeProfileHorary(){
|
||
}
|
||
/**Contructor de TsafeProfileHorary
|
||
@param pPk Clave Primaria del entity
|
||
@param pRegistercode Codigo de registro es la suma de los campos de la llave primaria
|
||
@param pInittime Horas y minutos desde la cual es disponible la transaccion para el dia
|
||
@param pFinishtime Horas y minutos hasta la cual es disponible la transaccion para el dia
|
||
*/
|
||
public TsafeProfileHorary(TsafeProfileHoraryKey pPk,String pRegistercode,String pInittime,String pFinishtime){
|
||
this();
|
||
pk=pPk;
|
||
registercode=pRegistercode;
|
||
inittime=pInittime;
|
||
finishtime=pFinishtime;
|
||
}
|
||
/**
|
||
* 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 TsafeProfileHorary
|
||
*/
|
||
public static TsafeProfileHorary find(EntityManager pEntityManager,TsafeProfileHoraryKey pKey) throws Exception{
|
||
TsafeProfileHorary obj = pEntityManager.find(TsafeProfileHorary.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TsafeProfileHorary
|
||
@return El objeto que referencia a la Clave primaria de TsafeProfileHorary
|
||
*/
|
||
public TsafeProfileHoraryKey getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TsafeProfileHorary
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TsafeProfileHorary
|
||
*/
|
||
public void setPk(TsafeProfileHoraryKey pPk){
|
||
pk=pPk;
|
||
}
|
||
/**Obtiene el valor de registercode
|
||
@return valor de registercode*/
|
||
public String getRegistercode(){
|
||
return registercode;
|
||
}
|
||
/**Fija el valor de registercode
|
||
@param pRegistercode nuevo Valor de registercode*/
|
||
public void setRegistercode(String pRegistercode){
|
||
registercode=pRegistercode;
|
||
}
|
||
|
||
/**Obtiene el valor de recordversion
|
||
@return valor de recordversion*/
|
||
public Integer getRecordversion(){
|
||
return recordversion;
|
||
}
|
||
/**Fija el valor de recordversion
|
||
@param pRecordversion nuevo Valor de recordversion*/
|
||
public void setRecordversion(Integer pRecordversion){
|
||
recordversion=pRecordversion;
|
||
}
|
||
|
||
/**Obtiene el valor de inittime
|
||
@return valor de inittime*/
|
||
public String getInittime(){
|
||
return inittime;
|
||
}
|
||
/**Fija el valor de inittime
|
||
@param pInittime nuevo Valor de inittime*/
|
||
public void setInittime(String pInittime){
|
||
inittime=pInittime;
|
||
}
|
||
|
||
/**Obtiene el valor de finishtime
|
||
@return valor de finishtime*/
|
||
public String getFinishtime(){
|
||
return finishtime;
|
||
}
|
||
/**Fija el valor de finishtime
|
||
@param pFinishtime nuevo Valor de finishtime*/
|
||
public void setFinishtime(String pFinishtime){
|
||
finishtime=pFinishtime;
|
||
}
|
||
|
||
/**Obtiene el valor de validateamount
|
||
@return valor de validateamount*/
|
||
public String getValidateamount(){
|
||
return validateamount;
|
||
}
|
||
/**Fija el valor de validateamount
|
||
@param pValidateamount nuevo Valor de validateamount*/
|
||
public void setValidateamount(String pValidateamount){
|
||
validateamount=pValidateamount;
|
||
}
|
||
|
||
public boolean equals(Object rhs){
|
||
if (rhs == null)return false;
|
||
if (! (rhs instanceof TsafeProfileHorary))return false;
|
||
TsafeProfileHorary that = (TsafeProfileHorary) rhs;
|
||
if (this.getPk() == null || that.getPk() == null)
|
||
return false;
|
||
return (this.getPk().equals(that.getPk()));
|
||
}
|
||
/**Implementaci<63>n del metodo hashCode de la la entidad TsafeProfileHorary
|
||
@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;
|
||
}
|
||
/**Implementaci<63>n 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;
|
||
}
|
||
/**Implementaci<63>n de la creaci<63>n de un bean en blanco TsafeProfileHorary
|
||
*/
|
||
public Object createInstance(){
|
||
TsafeProfileHorary instance=new TsafeProfileHorary();
|
||
instance.setPk(new TsafeProfileHoraryKey());
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TsafeProfileHorary
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TsafeProfileHorary p=(TsafeProfileHorary)this.clone();
|
||
p.setPk((TsafeProfileHoraryKey)this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
}
|