This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Don't get me started about those stupid light bulbs.
 
subject: ProjectionList hibernate Criteria
 
Similar Threads
Retrieve collections using projections
why it is inserting the values in the rows again
about inner join and inner join fetch again
Problem with Hibernate Criteria, Projections and associations
new to hibernate, spring.. criteria queries/joins