• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic