Hibernate generator classes

Extracted from Hibernate online official tutorials In Hibernate the optional <generator> child element names a Java class used to generate unique identifiers for instances of the persistent class. If any parameters are required to configure or initialize the generator instance, they are passed using the <param> element. <id name=”id” type=”long” column=”cat_id”> <generator class=”org.hibernate.id.TableHiLoGenerator”> <param name=”table”>uid_table</param>Continue reading “Hibernate generator classes”

Advantages of Hibernate

Caching objects. The session is a transaction-level cache of persistent objects. You may also enable a JVM-level/cluster cache to memory and/or local disk. Executing SQL statements later, when needed. The session never issues an INSERT or UPDATE until it is actually needed. So if an exception occurs and you need to abort the transaction, someContinue reading “Advantages of Hibernate”

‘Hibernate Dialect property’ for Different Databases

Hibernate is the most common and famous ORM using these days. It has a property called “Dialect” through which we tells Hibernate that we are using ‘this specific’ database. Here in this post you can see the dialect property values which we have to give for different databases. Click here to Read Full Article

Commonly used Generators in ‘Hibernate’

Generator Description increment It generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. It should not the used in the clustered environment. identity It supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is ofContinue reading “Commonly used Generators in ‘Hibernate’”