There are 3 states of object (instance) in hibernate.
There can be 4 types of association mapping in hibernate.
If you mark a class as mutable="false", class will be treated as an immutable class. By default, it is mutable="true".
No, collection mapping can only be performed with One-to-Many and Many-to-Many
Lazy loading in hibernate improves the performance. It loads the child objects on demand. Since Hibernate 3, lazy loading is enabled by default, you don't need to do lazy="true". It means not to load the child objects when parent is loaded.
Hibernate Query Language is known as an object oriented query language. It is like structured query language (SQL).
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.
|Only use the load() method if you are sure that the object exists.||If you are not sure that the object exists, then use one of the get()methods.|
|load() method will throw an exception if the unique id is not found in the database.||get() method will return null if the unique id is not found in the database.|
|load() just returns a proxy by default and database wonï¿½t be hit until the proxy is first invoked.||get() will hit the database immediately.|
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.