Hi I�ve never done with a triple pk but I�ve done with a double one, also I�m using WL6.1 and ejb20, here goes an example, I think it�ll help you.
regards.
<code>
package br.com.mmaia.ejb20.assucena;
public class MedidorPK implements java.io.Serializable
{
public
String nome_empresa;
public String numero_medidor;
private int hashCode = -1;
public MedidorPK() {}
public MedidorPK(String nome_empresa, String numero_medidor)
{
this.nome_empresa = nome_empresa;
this.numero_medidor = numero_medidor;
}
public boolean equals(Object objeto_comparado)
{
if (objeto_comparado == this) return true;
if (!(objeto_comparado instanceof MedidorPK))
return false;
MedidorPK medidorPK = (MedidorPK)objeto_comparado;
if (medidorPK.hashCode() == hashCode()) {
return nome_empresa.equals(medidorPK.nome_empresa) &&
numero_medidor.equals(medidorPK.numero_medidor);
} else {
return false;
}
}
public int hashCode() {
if (hashCode == -1) {
hashCode = nome_empresa.hashCode() ^ numero_medidor.hashCode();
}
return hashCode;
}
public String toString() {
return "(" + nome_empresa + ", " + numero_medidor + ")";
}
}
</code>