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
|