posted 20 years ago
Is there any way to use an object for generating a sequence?
I have a scenario where a field needs to be continually updated (kinda like a timestamp) with a unique identifier which I was planning on using a sequence for. The record containing that field is not persisted to the database until much later in the business process.
<hibernate-mapping package="com.impl" auto-import="true">
<class name="ObjectImpl" table="object_table" dynamic-update="true">
<id name="id" column="id" type="long">
<generator class="sequence">
<param name="sequence">id_seq</param>
</generator>
</id>
<property name="poNumber" column="po_number" type="long"/>
</class>
</hibernate-mapping>