• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate

 
Manny Bhan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
who updates this property and based on what ?
there is the version/timestamp property in hibernate but they are only changed when the object is persisted.

pascal
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!