This content has been marked as final.
Show 4 replies
-
1. Re: @Versioned(modificationType = {modificationType.UPDATE,
adamw Aug 25, 2008 4:13 AM (in response to dipasab1)Hello,
I don't quite understand your question - what do you mean by saying that certain properties should only be versioned if they are changed? A new revision for an entity is created only if that entity is changed.
Adam -
2. Re: @Versioned(modificationType = {modificationType.UPDATE,
dipasab1 Aug 25, 2008 12:55 PM (in response to dipasab1)Hi
What I mean is, I don't need a Revision when an Entity is created but only if the Entity is updated or deleted. -
3. Re: @Versioned(modificationType = {modificationType.UPDATE,
plaky Aug 25, 2008 1:30 PM (in response to dipasab1)"dipasab" wrote:
Hi
What I mean is, I don't need a Revision when an Entity is created but only if the Entity is updated or deleted.
Hi,
you can try to remove the listener "hibernate.ejb.event.post-insert" from your persistence.xml. Then no revision is generated for a new object ("create"). Revisions are only generated on update and delete.
The problem:
The state of the created object would not be versioned.
Try to:
1) create an object with name="a"
2) persist
3) update this object to name="b"
4) persist (merge)
Result in "normal" table:
id|name
1|a
Result in "versions" table:
1|b
So the first state of the object is deleted..
Kind regards
Sebastian -
4. Re: @Versioned(modificationType = {modificationType.UPDATE,
dipasab1 Aug 29, 2008 5:16 AM (in response to dipasab1)Hi Sebastian
Thanks for your replay and sorry for my late answer...
I will try out your suggestion.
Thanks