0 Replies Latest reply on Apr 23, 2006 12:44 AM by Alfonso Kim

    pk class

    Alfonso Kim Newbie


      im using CMP in JBoss 4.0.1 and MySQL.

      I have one table that maps to this PK-class:

      package examenes.service.ejb.keys;
      public class ExamenesResueltosKey implements java.io.Serializable{
       public Integer idUsuario;
       public Integer idExamen;
       public Integer idReactivo;
       public ExamenesResueltosKey(){}
       public Integer getIdUsuario(){ return idUsuario; }
       public void setIdUsuario(Integer idUsuario){ this.idUsuario = idUsuario; }
       public Integer getIdExamen(){ return idExamen; }
       public void setIdExamen(Integer idExamen){ this.idExamen = idExamen; }
       public Integer getIdReactivo(){ return idReactivo; }
       public void getIdReactivo(Integer idReactivo){ this.idReactivo = idReactivo; }
       public boolean equals(Object elOtro){
       if(elOtro instanceof ExamenesResueltosKey){
       return ((((ExamenesResueltosKey)elOtro).getIdUsuario() == this.getIdUsuario()) &&
       (((ExamenesResueltosKey)elOtro).getIdExamen() == this.getIdExamen()) &&
       (((ExamenesResueltosKey)elOtro).getIdReactivo() == this.getIdReactivo()));
       return false;
       public int hashCode(){
       String jijos = ("" + this.getIdUsuario() + this.getIdExamen() + this.getIdReactivo());
       return jijos.hashCode();


      in ejb-jar.xml:


      I want to know how many <primkey-field>, because the pk-field is composed by 3 Integers

      also, in jbosscmp-jdbc.xml i down know what must be in


      i must map the 3 fields?

      thanks in advance, greetings from Mexico