package com.fitbank.hb.persistence.invest;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Timestamp;

/**Clase que hace referencia a la Clave Primaria de TTITULOSVALORCARACTERISTICAS*/
public class TtitlepropertiesKey    implements Serializable,Cloneable{
/** Nombre de la Tabla TTITULOSVALORCARACTERISTICAS */
public static final String TABLE_NAME = "TTITULOSVALORCARACTERISTICAS";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Codigo de tipo de portafolio de inversiones (Propio, De terceros)
*/
private String ctipoportafolio;

/**
* Codigo del tipo de titulo valor como Bono, Accion
*/
private String ctipotitulovalor;

/**
* Codigo del tipo de instrumento de inversiones
*/
private Integer ctipoinstrumento;

/**
* Fecha hasta la que esta vigentes las caracteristicas de un titulo valor
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TtitlepropertiesKey(){}
/**Contructor de TtitlepropertiesKey
@param pCtipoportafolio Codigo de tipo de portafolio de inversiones (Propio, De terceros)
@param pCtipotitulovalor Codigo del tipo de titulo valor como Bono, Accion
@param pCtipoinstrumento Codigo del tipo de instrumento de inversiones
@param pFhasta Fecha hasta la que esta vigentes las caracteristicas de un titulo valor
*/
public TtitlepropertiesKey(String pCtipoportafolio,String pCtipotitulovalor,Integer pCtipoinstrumento,Timestamp pFhasta){
 ctipoportafolio=pCtipoportafolio;
 ctipotitulovalor=pCtipotitulovalor;
 ctipoinstrumento=pCtipoinstrumento;
 fhasta=pFhasta;
}
public static final String CTIPOPORTAFOLIO="CTIPOPORTAFOLIO";
/**Obtiene el valor de ctipoportafolio
@return valor de ctipoportafolio*/
public String getCtipoportafolio(){
  return ctipoportafolio;
}
/**Fija el valor de ctipoportafolio
@param pCtipoportafolio nuevo Valor de ctipoportafolio*/
public void setCtipoportafolio(String pCtipoportafolio){
  ctipoportafolio=pCtipoportafolio;
}

public static final String CTIPOTITULOVALOR="CTIPOTITULOVALOR";
/**Obtiene el valor de ctipotitulovalor
@return valor de ctipotitulovalor*/
public String getCtipotitulovalor(){
  return ctipotitulovalor;
}
/**Fija el valor de ctipotitulovalor
@param pCtipotitulovalor nuevo Valor de ctipotitulovalor*/
public void setCtipotitulovalor(String pCtipotitulovalor){
  ctipotitulovalor=pCtipotitulovalor;
}

public static final String CTIPOINSTRUMENTO="CTIPOINSTRUMENTO";
/**Obtiene el valor de ctipoinstrumento
@return valor de ctipoinstrumento*/
public Integer getCtipoinstrumento(){
  return ctipoinstrumento;
}
/**Fija el valor de ctipoinstrumento
@param pCtipoinstrumento nuevo Valor de ctipoinstrumento*/
public void setCtipoinstrumento(Integer pCtipoinstrumento){
  ctipoinstrumento=pCtipoinstrumento;
}

public static final String FHASTA="FHASTA";
/**Obtiene el valor de fhasta
@return valor de fhasta*/
public Timestamp getFhasta(){
  return fhasta;
}
/**Fija el valor de fhasta
@param pFhasta nuevo Valor de fhasta*/
public void setFhasta(Timestamp pFhasta){
  fhasta=pFhasta;
}

public static final String PK_CTIPOPORTAFOLIO="CTIPOPORTAFOLIO";
public static final String PK_CTIPOTITULOVALOR="CTIPOTITULOVALOR";
public static final String PK_CTIPOINSTRUMENTO="CTIPOINSTRUMENTO";
public static final String PK_FHASTA="FHASTA";
/**Implementaci?n de la comparaci?n de TtitlepropertiesKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TtitlepropertiesKey)){return false;}
  TtitlepropertiesKey that = (TtitlepropertiesKey) o;
  if (this.getCtipoportafolio() == null || that.getCtipoportafolio() == null){
      return false;
  }
  if (! this.getCtipoportafolio().equals(that.getCtipoportafolio())){
    return false;
  }
  if (this.getCtipotitulovalor() == null || that.getCtipotitulovalor() == null){
      return false;
  }
  if (! this.getCtipotitulovalor().equals(that.getCtipotitulovalor())){
    return false;
  }
  if (this.getCtipoinstrumento() == null || that.getCtipoinstrumento() == null){
      return false;
  }
  if (! this.getCtipoinstrumento().equals(that.getCtipoinstrumento())){
    return false;
  }
  if (this.getFhasta() == null || that.getFhasta() == null){
      return false;
  }
  if (! this.getFhasta().equals(that.getFhasta())){
    return false;
  }
  return true;
}
/**Implementaci?n del m?todo hashCode bajo el patr?n de Bloch
@return hashCode de la instancia TtitlepropertiesKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCtipoportafolio() == null ? 0 : this.getCtipoportafolio().hashCode());
    result = result * 37 + (this.getCtipotitulovalor() == null ? 0 : this.getCtipotitulovalor().hashCode());
    result = result * 37 + (this.getCtipoinstrumento() == null ? 0 : this.getCtipoinstrumento().hashCode());
    result = result * 37 + (this.getFhasta() == null ? 0 : this.getFhasta().hashCode());
    this.hashValue = result;
  }
  return this.hashValue;
}
public Object cloneMe() throws Exception {
  return this.clone();
}
/**Implementaci?n toString
*/
public String toString() {
	Field[]fs=this.getClass().getDeclaredFields();
	String data="";
	for(Field f:fs){
	 try{	
	 String name=f.getName();
	 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;
	}
}
