maia/.svn/pristine/27/27ea4c54e8cc8f2594d2a90fbe7...

179 lines
4.8 KiB
Plaintext
Executable File
Raw Permalink Blame History

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 TGENEPARROQUIA*/
@Embeddable
public class TgeneParroquiaKey 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;
@Column(name="PARROQUIACODE", nullable=false,updatable=false)
/**
* Codigo de parroquia
*/
private String parroquiacode;
/**Contructor por defecto*/
public TgeneParroquiaKey(){}
/**Contructor de TgeneParroquiaKey
@param pCountrycode Codigo de pais
@param pProvincecode Codigo de provincia
@param pCantoncode Codigo de canton
@param pParroquiacode Codigo de parroquia
*/
public TgeneParroquiaKey(String pCountrycode,String pProvincecode,String pCantoncode,String pParroquiacode){
countrycode=pCountrycode;
provincecode=pProvincecode;
cantoncode=pCantoncode;
parroquiacode=pParroquiacode;
}
/**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;
}
/**Obtiene el valor de parroquiacode
@return valor de parroquiacode*/
public String getParroquiacode(){
return parroquiacode;
}
/**Fija el valor de parroquiacode
@param pParroquiacode nuevo Valor de parroquiacode*/
public void setParroquiacode(String pParroquiacode){
parroquiacode=pParroquiacode;
}
/**Implementaci<63>n de la comparaci<63>n de TgeneParroquiaKey
@param o Objeto de comparaci<63>n
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneParroquiaKey))return false;
TgeneParroquiaKey that = (TgeneParroquiaKey) 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;
}
if (this.getParroquiacode() == null || that.getParroquiacode() == null){
return false;
}
if (! this.getParroquiacode().equals(that.getParroquiacode())){
return false;
}
return true;
}
/**Implementaci<63>n del m<>todo hashCode bajo el patr<74>n de Bloch
@return hashCode de la instancia TgeneParroquiaKey
*/
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());
result = result * 37 + (this.getParroquiacode() == null ? 0 : this.getParroquiacode().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;
}
}