Primary keys assigned by triggers in Hibernate

By: Dorris Viewed: 193 times  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>

</generator>

</id>

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