Posted By:
liu_xj
Posted On:
Thursday, February 9, 2006 02:31 AM
About a j2ee-1_4-doc-tutorial_5 example:SavingsAccount I study ejb with j2ee-1_4-doc-tutorial_5,but when i test savingsaccount example,throws-> 15:00:44,781 WARN [verifier] EJB spec violation: Bean : SavingsAccount Method : public abstract void chargeForLowBalance(BigDecimal, BigDecimal) throws InsufficientBalanceException, RemoteException Section: 9.2.8 Warning: Each method defined in the entity bean's home interface must be either create or finder method. ... why?all code is follow j2ee-Specification!why? SavingsAccountHome.java public interface SavingsAccountHome extends EJBHome { //create metho
More>>
About a j2ee-1_4-doc-tutorial_5 example:SavingsAccount
I study ejb with j2ee-1_4-doc-tutorial_5,but when i test savingsaccount example,throws->
15:00:44,781 WARN [verifier] EJB spec violation:
Bean : SavingsAccount
Method : public abstract void chargeForLowBalance(BigDecimal, BigDecimal) throws InsufficientBalanceException,
RemoteException
Section: 9.2.8
Warning: Each method defined in the entity bean's home interface must be either create or finder method.
...
why?all code is follow j2ee-Specification!why?
SavingsAccountHome.java
public interface SavingsAccountHome extends EJBHome {
//create method
public SavingsAccount create(String id, String firstName, String lastName,
BigDecimal balance) throws CreateException,
RemoteException;
//finder method
public SavingsAccount findByPrimaryKey(String id)
throws FinderException,
RemoteException;
public Collection findByLastName(String lastName)
throws FinderException,
RemoteException;
public Collection findInRange(BigDecimal low, BigDecimal high)
throws
FinderException, RemoteException;
//home method
public void chargeForLowBalance(BigDecimal minimumBalance, BigDecimal charge)
throws InsufficientBalanceException, RemoteException;
}
part of SavingsAccountBean.java
//implement home's create method
public Object ejbCreate(String id, String firstName, String lastName,
BigDecimal balance) throws CreateException {
...
}
public void ejbPostCreate(String id, String firstName, String lastName,
BigDecimal balance) {
}
//implement home's find method
public String ejbFindByPrimaryKey(String primaryKey)
throws FinderException {
...
}
public Collection ejbFindByLastName(String lastName)
throws FinderException {
...
}
public String ejbFindByPrimaryKey(String primaryKey)
throws FinderException {
...
}
//implement home's method
public void ejbHomeChargeForLowBalance(BigDecimal minimumBalance,
BigDecimal charge) throws InsufficientBalanceException {
...
}
//implement Remote method
...
<<Less