-->
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: Mark object as dirty (version management)
PostPosted: Wed Dec 01, 2004 5:29 pm 
Beginner
Beginner

Joined: Tue Mar 16, 2004 5:15 am
Posts: 33
Hi there,

what I am up to is quite simple, I guess. A persistent object has an version attribute storing the object's version and of cause the version property is managed by hibernate.

The object also has an one-to-one association. The association herefor is completely transparent to a user of the object (hidden/transparent). So whenever the associated object is manipulated by the object (in response to an object-message aka method call), the version of the object should be changed on flush automatically (beside nothing of the object has changed).

I looked for a way to simply mark the object as dirty but I didn't found one. I am dreaming about something like session.touch(object) or session.markDirty(object). Like you might guess, I was out of luck and now I run out of ideas.

So if someone knows a way to mark the object as dirty without doing some fluff like setProperty(dummyValue) + setProperty(oldValue), I would be a happier human being.


Thanks for reading,

Martin (Kersten)

Hibernate version: 2.x


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 02, 2004 2:04 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
take a look at the reference-documentation ... i think an Interceptor could be quite useful ...

gtx
curio


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.