By: Dorris Emailed: 1729 times Printed: 2329 times
For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), you can use identity key generation. For databases that support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you can use sequence style key generation. Both of these strategies require two SQL queries to insert a new object. For example:
<id name="id" type="long" column="person_id">
<id name="id" type="long" column="person_id" unsaved-value="0">
For cross-platform development, the native strategy will, depending on the capabilities of the underlying database, choose from the identity, sequence and hilo strategies.
View Tutorial By: Steve at 2013-01-02 22:58:32
Most Viewed Articles (in Hibernate )
Most Emailed Articles (in Hibernate)