-
1. Re: Create versioned entities groups [ENVERS-6]
adamw Jun 6, 2008 4:47 AM (in response to aamonten)Hello,
yes, I think that would be a good way. If I understand you correctly, your name is my group name? :) But I think that a "default" field is not necessary - an empty name (which would be the default value for the name attribute in @Versioned and @RevisionEntity) could take that role.
One more thing ... there is a possibility that you don't mark the whole entity with @Versioned, but only individual fields (if you don't want everything to be versioned). And when you do so, where do you put the information about the group name? Maybe it would make sense then to have an additional @VersionedGroup annotation, which would always be at the class level? What do you think?
--
Adam -
2. Re: Create versioned entities groups [ENVERS-6]
aamonten Jun 6, 2008 10:04 AM (in response to aamonten)"adamw" wrote:
Hello,
yes, I think that would be a good way. If I understand you correctly, your name is my group name? :)
Yes, name == group name"adamw" wrote:
But I think that a "default" field is not necessary - an empty name (which would be the default value for the name attribute in @Versioned and @RevisionEntity) could take that role.
Ok, but then Envers should restrict that there can only be one @RevisionEntity without a name (kind of obvious :S). What about if there is an Entity without a group name and no default @RevisionEntity, should this Entity be associated with any @RevisionEntity, or should it throw an exception?
I like the second option"adamw" wrote:
One more thing ... there is a possibility that you don't mark the whole entity with @Versioned, but only individual fields (if you don't want everything to be versioned). And when you do so, where do you put the information about the group name? Maybe it would make sense then to have an additional @VersionedGroup annotation, which would always be at the class level? What do you think?
--
Adam
I like this idea, again if the @VersionedGroup is not set, then associate it with the default and if default doesn't exist throw an exception.
If you're agree I will start working on it. -
3. Re: Create versioned entities groups [ENVERS-6]
adamw Jun 7, 2008 1:23 PM (in response to aamonten)Hello,
sounds great :). I also think that an exception should be thrown when no @VersionedGroup is set, and there is no @RevisionEntity with an empty group name.
Let me know if you'd need any help.
--
Adam