• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please explain theoretically how the Hiber. Criteria Query works for selecting records from Database

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the following lines of code mean ?



Please explain me theorecticall how extaclly it is working in the background while fetching records from database through hibernate criteria query..

Thank you in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Criteria crit = s.createCriteria(RegForm.class);
List list = crit.list();

The first line creates a criterion for the mapped class RegForm. The second line runs a query based on this criterion. In the background Hibernate maops from this class to a database table using a dialect and constructs the appropriate SQL to query against the database. See the documentation for more.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic