Interstage Application Server J2EE ユーザーズガイド
|
目次
索引
|
12.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();
}
}
All Rights Reserved, Copyright(C) 富士通株式会社 2005