Get all updates of Java4s
Follow Us: Email Newsletter

Hibernate Projections, Example On Hibernate Projections

Hibernate » On Jul 13, 2011 { 1 Comment } By Sivateja

Now we will see how to use this criteria to select partial objects from the database with the help of projections, (Remember, We cant select partial objects in criteria with out projections support)

files required…

  • class)
  • Product.hbm.xml
  • hibernate.cfg.xml
  • (For writing our business logic)




  • In the above line numbers 2637 , we loaded product name column so i typecast into String  in while loop
  • but from 39, i loaded price column, actually price always used to be in the form of double right so, we must typecast into double

And that’s it.., hope you clear about this concept (make sure you must see the previous sessions then only you will understand this program 100%), let us see the Example Program On Hibernate Criteria With Multiple Projections in the next session

You Might Also Like

  ♦ About Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


One Response to “Hibernate Projections, Example On Hibernate Projections”
  1. INDIAN says:

    Nice Tutorial


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2016 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.