Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ProjectionList hibernate Criteria

 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, am struggling to understand the use of Projections.property... consider the followin



What's the use of it here?
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Projections.property is used to retrieve specific columns from the datbase using the Criteria API...

ex:


to retrieve only the name & age of the employee i would say


if we run the criteria without the projectionlist added then we would get a query like select id, name, age from Employee.

Hope this helps.


- Anantha Sharma
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anantha Sharma wrote:Projections.property is used to retrieve specific columns from the datbase using the Criteria API...

ex:


to retrieve only the name & age of the employee i would say


if we run the criteria without the projectionlist added then we would get a query like select id, name, age from Employee.

Hope this helps.


- Anantha Sharma


Thanks Anantha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic