Good afternoon.
Common entty bean contain a number of set and get methods. Here we have a Customer bean with field named credits.
Also we have a Session bean named Cashier with deposit method. In general this method looks like:
public void deposit(Integer customerId, int value) throws RemoteException {
try {
CustomerLocal customer = this.customerHome.findByPrimaryKey(customerId);
int credits = customer.getCredits()+value;
if(credits < 0) {
throw new OutOfCreditsBuisenessException("....");
}
customer.setCredits(credits);
} catch .... {
///.... bla bla. catch some common exceptions
}
}
Oh, same on me... wrong forum.
Somebody please remove topic from here. I've already reposted it to "Persistance" forum http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3948303#3948303