Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to select particular column in findAll() method

 
Balachandran Vijayarajan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Its possible to select particular column in EJB QL in findAll() method. For example "select a.firstName,a.userId,a.lastName from EntitlementUserBean a" - here "EntitlementUserBean" entity bean name.


Thanks a lot,

Bala
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, because those are what is called Projection Queries, so in that case, then there would be no way to determine what type of object to create. In EJBs for Entity beans, it has to bring back all the fields of the entity beans populated. Now in EJB 3.0 and JPA, you can create project querires that create other types of objects that aren't entity beans.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic