332 lines
8.9 KiB
Plaintext
Executable File
332 lines
8.9 KiB
Plaintext
Executable File
package com.fp.persistence.pviaticos.solicitud;
|
|
|
|
import java.io.Serializable;
|
|
import java.lang.reflect.Field;
|
|
import java.sql.Date;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.EmbeddedId;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.EntityManager;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.Transient;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Parameter;
|
|
|
|
import com.fp.dto.hb.HibernateBean;
|
|
|
|
/** Clase que implementa la entidad de Hibernate que hace referencia a la tabla VIA_SOL_TRANSPORTE */
|
|
@Entity(name = "ViaSolicitudTransporte")
|
|
@Table(name = "VIA_SOL_TRANSPORTE")
|
|
public class ViaSolicitudTransporte 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 ViaSolicitudTransporte
|
|
*/
|
|
@EmbeddedId
|
|
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SubSequenceKey", parameters = {
|
|
@Parameter(name = "sql", value = "select coalesce(max(COD_SECUENCIA),0)+1 from VIA_SOL_TRANSPORTE "
|
|
+ "where COD_SOLICITUD=:cod_solicitud "), @Parameter(name = "type", value = "java.lang.Integer"),
|
|
@Parameter(name = "param", value = "cod_solicitud,pk.cod_solicitud"), @Parameter(name = "field", value = "cod_secuencia") })
|
|
@GeneratedValue(generator = "seq_id")
|
|
private ViaSolicitudTransporteKey pk;
|
|
|
|
@Column(name = "COD_TIP_TRANSPORTE", nullable = true)
|
|
/**
|
|
* T terrestre, A aereo, M maritimo
|
|
*/
|
|
private String cod_tip_transporte;
|
|
|
|
@Column(name = "TXT_TRANSPORTE", nullable = true)
|
|
/**
|
|
* Nombre de la empresa de transporte
|
|
*/
|
|
private String txt_transporte;
|
|
|
|
@Column(name = "TXT_RUTA", nullable = true)
|
|
/**
|
|
* Ruta utilizada para el transporte
|
|
*/
|
|
private String txt_ruta;
|
|
|
|
@Column(name = "FEC_SALIDA", nullable = true)
|
|
/**
|
|
* Fecha inicio del viaje
|
|
*/
|
|
private Date fec_salida;
|
|
|
|
@Column(name = "FEC_LLEGADA", nullable = true)
|
|
/**
|
|
* Fecha llegada
|
|
*/
|
|
private Date fec_llegada;
|
|
|
|
@Column(name = "FEC_HORA_SALIDA", nullable = true)
|
|
/**
|
|
* Hora de inicio del viaje
|
|
*/
|
|
private String fec_hora_salida;
|
|
|
|
@Column(name = "FEC_HORA_LLEGADA", nullable = true)
|
|
/**
|
|
* Hora de llegada
|
|
*/
|
|
private String fec_hora_llegada;
|
|
|
|
/** Contructor por defecto */
|
|
public ViaSolicitudTransporte() {
|
|
}
|
|
|
|
/**
|
|
* Contructor de ViaSolicitudTransporte
|
|
*
|
|
* @param pPk Clave Primaria del entity
|
|
*/
|
|
public ViaSolicitudTransporte(ViaSolicitudTransporteKey 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 ViaSolicitudTransporte
|
|
*/
|
|
public static ViaSolicitudTransporte find(EntityManager pEntityManager, ViaSolicitudTransporteKey pKey) throws Exception {
|
|
ViaSolicitudTransporte obj = pEntityManager.find(ViaSolicitudTransporte.class, pKey);
|
|
return obj;
|
|
}
|
|
|
|
/**
|
|
* Entrega la Clave primaria de ViaSolicitudTransporte
|
|
*
|
|
* @return El objeto que referencia a la Clave primaria de ViaSolicitudTransporte
|
|
*/
|
|
public ViaSolicitudTransporteKey getPk() {
|
|
return pk;
|
|
}
|
|
|
|
/**
|
|
* Fija un nuevo valor a la Clave primaria de ViaSolicitudTransporte
|
|
*
|
|
* @param pPk El objeto que referencia a la nueva Clave primaria de ViaSolicitudTransporte
|
|
*/
|
|
public void setPk(ViaSolicitudTransporteKey pPk) {
|
|
pk = pPk;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de cod_tip_transporte
|
|
*
|
|
* @return valor de cod_tip_transporte
|
|
*/
|
|
public String getCod_tip_transporte() {
|
|
return cod_tip_transporte;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de cod_tip_transporte
|
|
*
|
|
* @param pCod_tip_transporte nuevo Valor de cod_tip_transporte
|
|
*/
|
|
public void setCod_tip_transporte(String pCod_tip_transporte) {
|
|
cod_tip_transporte = pCod_tip_transporte;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de txt_transporte
|
|
*
|
|
* @return valor de txt_transporte
|
|
*/
|
|
public String getTxt_transporte() {
|
|
return txt_transporte;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de txt_transporte
|
|
*
|
|
* @param pTxt_transporte nuevo Valor de txt_transporte
|
|
*/
|
|
public void setTxt_transporte(String pTxt_transporte) {
|
|
txt_transporte = pTxt_transporte;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de txt_ruta
|
|
*
|
|
* @return valor de txt_ruta
|
|
*/
|
|
public String getTxt_ruta() {
|
|
return txt_ruta;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de txt_ruta
|
|
*
|
|
* @param pTxt_ruta nuevo Valor de txt_ruta
|
|
*/
|
|
public void setTxt_ruta(String pTxt_ruta) {
|
|
txt_ruta = pTxt_ruta;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de fec_salida
|
|
*
|
|
* @return valor de fec_salida
|
|
*/
|
|
public Date getFec_salida() {
|
|
return fec_salida;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de fec_salida
|
|
*
|
|
* @param pFec_salida nuevo Valor de fec_salida
|
|
*/
|
|
public void setFec_salida(Date pFec_salida) {
|
|
fec_salida = pFec_salida;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de fec_llegada
|
|
*
|
|
* @return valor de fec_llegada
|
|
*/
|
|
public Date getFec_llegada() {
|
|
return fec_llegada;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de fec_llegada
|
|
*
|
|
* @param pFec_llegada nuevo Valor de fec_llegada
|
|
*/
|
|
public void setFec_llegada(Date pFec_llegada) {
|
|
fec_llegada = pFec_llegada;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de fec_hora_salida
|
|
*
|
|
* @return valor de fec_hora_salida
|
|
*/
|
|
public String getFec_hora_salida() {
|
|
return fec_hora_salida;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de fec_hora_salida
|
|
*
|
|
* @param pFec_hora_salida nuevo Valor de fec_hora_salida
|
|
*/
|
|
public void setFec_hora_salida(String pFec_hora_salida) {
|
|
fec_hora_salida = pFec_hora_salida;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de fec_hora_llegada
|
|
*
|
|
* @return valor de fec_hora_llegada
|
|
*/
|
|
public String getFec_hora_llegada() {
|
|
return fec_hora_llegada;
|
|
}
|
|
|
|
/**
|
|
* Fija el valor de fec_hora_llegada
|
|
*
|
|
* @param pFec_hora_llegada nuevo Valor de fec_hora_llegada
|
|
*/
|
|
public void setFec_hora_llegada(String pFec_hora_llegada) {
|
|
fec_hora_llegada = pFec_hora_llegada;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object rhs) {
|
|
if (rhs == null)
|
|
return false;
|
|
if (!(rhs instanceof ViaSolicitudTransporte))
|
|
return false;
|
|
ViaSolicitudTransporte that = (ViaSolicitudTransporte) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
|
|
/**
|
|
* Implementacion del metodo hashCode de la la entidad ViaSolicitudTransporte
|
|
*
|
|
* @return el hashCode la instancia
|
|
*/
|
|
@Override
|
|
public int hashCode() {
|
|
if (hashValue == 0) {
|
|
int result = 17;
|
|
if (this.getPk() == null) {
|
|
result = super.hashCode();
|
|
} else {
|
|
result = this.getPk().hashCode();
|
|
}
|
|
hashValue = result;
|
|
}
|
|
return hashValue;
|
|
}
|
|
|
|
/** Implementacion toString */
|
|
@Override
|
|
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 ViaSolicitudTransporte */
|
|
@Override
|
|
public Object createInstance() {
|
|
ViaSolicitudTransporte instance = new ViaSolicitudTransporte();
|
|
instance.setPk(new ViaSolicitudTransporteKey());
|
|
return instance;
|
|
}
|
|
|
|
/**
|
|
* Clona la entidad ViaSolicitudTransporte
|
|
*
|
|
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
@Override
|
|
public Object cloneMe() throws CloneNotSupportedException {
|
|
ViaSolicitudTransporte p = (ViaSolicitudTransporte) this.clone();
|
|
p.setPk((ViaSolicitudTransporteKey) pk.cloneMe());
|
|
return p;
|
|
}
|
|
}
|