Meaningless Drivel is fun!*
The moose likes Object Relational Mapping and the fly likes ProjectionList hibernate Criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "ProjectionList hibernate Criteria" Watch "ProjectionList hibernate Criteria" New topic
Author

ProjectionList hibernate Criteria

Sonx Nkuks
Ranch Hand

Joined: Aug 20, 2010
Posts: 47
Hi, am struggling to understand the use of Projections.property... consider the followin



What's the use of it here?
Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

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

Joined: Aug 20, 2010
Posts: 47
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ProjectionList hibernate Criteria
 
Similar Threads
Retrieve collections using projections
Problem with Hibernate Criteria, Projections and associations
new to hibernate, spring.. criteria queries/joins
why it is inserting the values in the rows again
about inner join and inner join fetch again