Hello
I'd like to create a method helper on EJB3 entity bean in order to
check that a set does not violates any constraint.
ex, in acccount class, i create à debit(a) method, implementing it:
public void debit(int a) if (this.amount>a) { setAmount(getAmount()-a) } else { ????? }
You should be able to inject the context of your EJB depending upon the type of bean:
@Resource private transient SessionContext ctx;
@Resource private transient EntityContext ctx;