• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic