Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
reuben juste
363 Pointssession.createCriteria is depracated
In hibernate 5.2, session.createCriteria has been depracated and they recommend to use JPA criterias for hibernate sessions. How would that be done?
1 Answer
Chris Ramacciotti
Treehouse Guest TeacherHi Reuben - great question! First, an answer to your question. See my example for giflib-hibernate with this commit:
https://github.com/treehouse/giflib-hibernate/commit/4cd607e5dfde420e2e07d3970f4ede13f4cff783
Next, if you're interested in how this is being done behind the scenes, there is some great info in the migration guide for 5.2:
https://github.com/hibernate/hibernate-orm/wiki/Migration-Guide---5.2
The overall theme is that many more Hibernate features are conforming to the Java Persistence API, which makes the ORM you choose more loosely coupled to your code.