ページの先頭行へ戻る
Interstage Application Server/Interstage Web Server J2EE ユーザーズガイド

13.9.1 CMPの記述例

  package Sample;
  
  public class SampleBeanPrimaryKey implements java.io.Serializable
  {
      public Integer code;

      public SampleBeanPrimaryKey()
      {
      }

      public boolean equals(Object obj)
      {
          if (obj == null)
              return false;
          if (!(obj instanceof SampleBeanPrimaryKey))
              return false;
          SampleBeanPrimaryKey pk = (SampleBeanPrimaryKey)obj;
          boolean b = (code == null)?(pk.code == null):code.equals(pk.code);
          return b;
      }
      public int hashCode()
      {
          String temp = String.valueOf(code);
          return temp.hashCode();
      }
  }