Primary keys assigned by triggers in Hibernate

By: Dorris Printer Friendly Format    

Hibernate does not generate DDL with triggers. It is for legacy schemas only.

<id name="id" type="long" column="person_id">

<generator class="select">

<param name="key">socialSecurityNumber</param>



In the above example, there is a unique valued property named socialSecurityNumber. It is defined by the class, as a natural key and a surrogate key named person_id, whose value is generated by a trigger.

Most Viewed Articles (in Hibernate )

Latest Articles (in Hibernate)

Comment on this tutorial