File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ProjectionList hibernate Criteria