• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic