This content has been marked as final.
Show 3 replies
-
1. Re: CMP finder methods
clajoie Apr 23, 2004 5:41 AM (in response to ahardy66)No, Finder methods can return single beans. You just need to make sure that the query you execute will in fact only return one row or else you'll get an exception. Here's a snippet of XDoclet on a bean that finds a person by social security number and returns just a single Person bean
* @ejb.finder * signature="Person findBySsn(java.lang.String ssn)" * query="SELECT OBJECT(p) FROM Person p WHERE p.ssn = ?1"
Is UserLocal the local interface of a bean named User? If so try returning just User. -
2. Re: CMP finder methods
petino Apr 23, 2004 5:59 AM (in response to ahardy66)A correction: finder query which returns object should return _at_most_ one row. (hint: 0 rows for ObjectNotFound)
-
3. Re: CMP finder methods
ahardy66 Apr 23, 2004 6:05 AM (in response to ahardy66)
Grand. Thanks for the advice.
Petino - what are you hinting? No comprendo, senor.
Adam