サンプル

public class BeanClass implements javax.ejb.SessionBean {
public Collection ejbFindByPrimaryKey (String key) throws FinderException{
PrimaryKey pKey = new PrimaryKey(key);
Collection result;
searchByPrimaryKey(pKey);
if (pKey.exists())
result = pKey;
return result;
else
throw new ObjectNotFoundException("Primary Key "+ key + " not found");
}
//インターフェースを実装する必要のあるメソッド
}

解決策
ejbFindByPrimaryKey() は主キーを戻す必要があります。その他のファインダー・メソッドは、キーの集合を戻す必要があります。


public class BeanClass implements javax.ejb.SessionBean {
public String ejbFindByPrimaryKey (String key) throws FinderException{
PrimaryKey pKey = new PrimaryKey(key);
searchByPrimaryKey(pKey);
if (pKey.exists())
return key;
else
throw new ObjectNotFoundException("Primary Key "+ key + " not found");
}
//インターフェースを実装する必要のあるメソッド
}