-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: automatisch timestamp generieren
PostPosted: Thu Nov 15, 2007 9:14 am 
Newbie

Joined: Thu Nov 15, 2007 9:03 am
Posts: 1
wie muss man ein "timestamp" mapping konfigurieren, damit automatisch bei update oder insert ein neuer Wert geschrieben wird?

Dialekt ist MySQL
folgende mappings habe ich schon erfolglos probiert:

<property name="lastModified" column="lastmodified" type="timestamp" generated="always"/>


<timestamp name="lastModified" column="lastmodified" generated="always" />

<timestamp name="lastModified" column="lastmodified" generated="always" source="vm" ></timestamp>

<timestamp name="lastModified" column="lastmodified" generated="always" source="db" ></timestamp>

usw....
denke ich habe alle Kombinationen getestet.

kennt jemand dafür eine (mapping) Lösung?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 12:16 pm 
Newbie

Joined: Tue Oct 23, 2007 5:02 pm
Posts: 5
Hi,

was du machen kannst ist einfach das Optimistic-Locking mit einem Timestamp missbrauchen.
Einfach in deinem Mapping
<version type="timestamp"/>
einführen, dann wird bei jedem Speichern des Objektes der aktuelle Timestamp eingefügt.

Gruss

Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.