aspose file tools*
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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ProjectionList hibernate Criteria