1 Reply Latest reply on Oct 3, 2001 7:29 PM by Aaron Smith

    primary key class must be non-static. in JBoss

    Parshuram Walunjkar Newbie

      Hi all ,
      I am having such Warning when deploying the jar file.I am not using the static field but it gives such warning.
      Please suggest me.

      [Verifier]
      Bean : PIDETAIL
      Section: 9.4.7.2
      Warning: At least one field in the primary key class must be non-static.

      [Container factory] Deploying PIDETAIL
      [JAWS] Table 'PU_PO_DETAIL' already exists
      [ContainerManagement] Initializing
      [ContainerManagement] Initialized
      [ContainerManagement] Starting
      [ContainerManagement] Started
      [Container factory] Deployed application: file:/D:/JBossTomcat/JBoss-2.4.1_Tomcat-3.2.3/jboss/t
      mp/deploy/Default/PIDetail.jar/
      [J2EE Deployer Default] J2EE application: file:/D:/JBossTomcat/JBoss-2.4.1_Tomcat-3.2.3/jboss/d
      eploy/PIDetail.jar is deployed.


      *************************************** PK class ***************

      package examples.trial.detail;

      import java.io.*;

      public class PIDetailPK implements Serializable
      {
      private String poNo;//fk
      private int po_Srno; //pk
      private int revision_No;//fk

      public PIDetailPK()
      {
      }

      public PIDetailPK(String poNo,int po_Srno,int revision_No)
      {
      this.poNo = poNo;
      this.po_Srno = po_Srno;
      this.revision_No = revision_No;
      }

      public boolean equals(Object ThisKey)
      {
      if( ThisKey == null || !(ThisKey instanceof PIDetailPK) )
      return false ;
      PIDetailPK pk = (PIDetailPK)ThisKey ;
      if( (this.poNo.equals(pk.poNo)) && (this.revision_No == pk.revision_No) && (this.po_Srno == pk.po_Srno))
      return true ;
      return false ;
      }

      public int hashCode()
      {
      return ((this.toString()).hashCode()) ;
      }

      public String toString()
      {
      StringBuffer sb = new StringBuffer();
      sb.append(poNo);
      sb.append(revision_No);
      sb.append(po_Srno);
      return (sb.toString());
      }

      }

      *************************************** **************