What is the general flow of Hibernate communication with RDBMS?
The general flow of Hibernate communication with RDBMS is :
  1. Load the Hibernate configuration file and create configuration object. It will automatically load all hbm mapping files
  2. Create session factory from configuration object
  3. Get one session from this session factory
  4. Create HQL Query
  5. Execute query to get list containing Java objects
What is Hibernate Query Language (HQL)?
Hibernate offers a query language that embodies a very powerful and flexible mechanism to query, store, update, and retrieve objects from a database. This language, the Hibernate query Language (HQL), is an object-oriented extension to SQL.
How do you map Java Objects with Database tables?
  1. First we need to write Java domain objects (beans with setter and getter).
  2. Write hbm.xml, where we map java class to table and database columns to Java class variables.
Define cascade and inverse option in one-many mapping?
cascade - enable operations to cascade to child entities.
inverse - mark this collection as the "inverse" end of a bidirectional association.
Essentially "inverse" indicates which end of a relationship should be ignored, so when persisting a parent who has a collection of children, should you ask the parent for its list of children, or ask the children who the parents are?
What is the difference between and merge and update ?
Use update() if you are sure that the session does not contain an already persistent instance with the same identifier, and merge() if you want to merge your modifications at any time without consideration of the state of the session.