Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding ejb-ql and finder method return values?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according to my understanding finder methods return EJBObjects.
if ejb-ql is like
select Object(employee) from employee
then it is suitable for finder method.

what if ejb-ql is like
select employee.name from employee

is above sql is returning EJBObject?

Yamini
 
Vaithiya Sundaram
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finder method can return single EJBObject reference or collection of EJBObject references. So the query "select employee.name from employee" is not valid for the finder method as it gives single field value.
 
Paulo Asterio Nunes
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy yamini,

If you want use this query "select employee.name from employee" you sould use ejbSelect<METHOD> methods ...

Regards,

Paulo Nunes
Brazil
MCP OCP IBM285 SCJP 1.4 SCWCD 1.4 SCBCD 1.3
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!