Programming Tutorials

Primary keys assigned by triggers in Hibernate

By: Dorris in Hibernate Tutorials on 2011-01-01  

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.






Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Hibernate )

Latest Articles (in Hibernate)