152 lines
4.1 KiB
Plaintext
Executable File
152 lines
4.1 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.gene;
|
||
|
||
import javax.persistence.Column;
|
||
import java.io.Serializable;
|
||
import com.fp.dto.hb.HibernateId;
|
||
import java.lang.reflect.Field;
|
||
import javax.persistence.Embeddable;
|
||
import javax.persistence.Transient;
|
||
|
||
/**Clase que hace referencia a la Clave Primaria de TGENECANTON*/
|
||
@Embeddable
|
||
public class TgeneCantonKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
|
||
/**
|
||
* HashCode asociado con la Instancia
|
||
*/
|
||
@Transient
|
||
private int hashValue = 0;
|
||
/**
|
||
* Version de la Clase
|
||
*/
|
||
private static final long serialVersionUID = 1L;
|
||
@Column(name="COUNTRYCODE", nullable=false,updatable=false)
|
||
|
||
/**
|
||
* Codigo de pais
|
||
*/
|
||
private String countrycode;
|
||
|
||
@Column(name="PROVINCECODE", nullable=false,updatable=false)
|
||
|
||
/**
|
||
* Codigo de provincia
|
||
*/
|
||
private String provincecode;
|
||
|
||
@Column(name="CANTONCODE", nullable=false,updatable=false)
|
||
|
||
/**
|
||
* Codigo de canton
|
||
*/
|
||
private String cantoncode;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneCantonKey(){}
|
||
/**Contructor de TgeneCantonKey
|
||
@param pCountrycode Codigo de pais
|
||
@param pProvincecode Codigo de provincia
|
||
@param pCantoncode Codigo de canton
|
||
*/
|
||
public TgeneCantonKey(String pCountrycode,String pProvincecode,String pCantoncode){
|
||
countrycode=pCountrycode;
|
||
provincecode=pProvincecode;
|
||
cantoncode=pCantoncode;
|
||
}
|
||
/**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;
|
||
}
|
||
|
||
/**Obtiene el valor de cantoncode
|
||
@return valor de cantoncode*/
|
||
public String getCantoncode(){
|
||
return cantoncode;
|
||
}
|
||
/**Fija el valor de cantoncode
|
||
@param pCantoncode nuevo Valor de cantoncode*/
|
||
public void setCantoncode(String pCantoncode){
|
||
cantoncode=pCantoncode;
|
||
}
|
||
|
||
/**Implementaci<63>n de la comparaci<63>n de TgeneCantonKey
|
||
@param o Objeto de comparaci<63>n
|
||
*/
|
||
public boolean equals(Object o){
|
||
if (o == null)return false;
|
||
if (! (o instanceof TgeneCantonKey))return false;
|
||
TgeneCantonKey that = (TgeneCantonKey) o;
|
||
if (this.getCountrycode() == null || that.getCountrycode() == null){
|
||
return false;
|
||
}
|
||
if (! this.getCountrycode().equals(that.getCountrycode())){
|
||
return false;
|
||
}
|
||
if (this.getProvincecode() == null || that.getProvincecode() == null){
|
||
return false;
|
||
}
|
||
if (! this.getProvincecode().equals(that.getProvincecode())){
|
||
return false;
|
||
}
|
||
if (this.getCantoncode() == null || that.getCantoncode() == null){
|
||
return false;
|
||
}
|
||
if (! this.getCantoncode().equals(that.getCantoncode())){
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
/**Implementaci<63>n del m<>todo hashCode bajo el patr<74>n de Bloch
|
||
@return hashCode de la instancia TgeneCantonKey
|
||
*/
|
||
public int hashCode(){
|
||
if (this.hashValue == 0){
|
||
int result = 17;
|
||
result = result * 37 + (this.getCountrycode() == null ? 0 : this.getCountrycode().hashCode());
|
||
result = result * 37 + (this.getProvincecode() == null ? 0 : this.getProvincecode().hashCode());
|
||
result = result * 37 + (this.getCantoncode() == null ? 0 : this.getCantoncode().hashCode());
|
||
this.hashValue = result;
|
||
}
|
||
return this.hashValue;
|
||
}
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
return this.clone();
|
||
}
|
||
/**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+="pk."+name+"="+f.get(this)+";";
|
||
}catch(Exception e){
|
||
continue;
|
||
}
|
||
}
|
||
if(data.compareTo("")==0){
|
||
data=super.toString();
|
||
}
|
||
return data;
|
||
}
|
||
}
|