[hibernate-dev] Envers in Hibernate
adam at warski.org
Thu Oct 23 07:18:11 EDT 2008
>>> I can see the confusion. Hibernate has a similar annotation for
>>> optimistic locking which nearly matches "Versioned" in Envers.
>> Yes, @Version. But it's for a totally different thing. So far I
>> only once I had a question on the forum if @Versioned and @Version
>> are related in any way. Do you really think it creates confusion?
> I go with Steve here. I think 'Version' is really overloaded and
> there will be
> confusion between @Version and @Versioned, especially if they go
> into the same code base.
> Peronally, I consider the JPA @Version a bad name choice, but that
> cannot be changed.
Ok then :). @Historized? @Historic?
> I also agree with Steve that auditing seems to be the right word. I
> was several
> times asked whether Hibernate supports auditing and when I asked
> what they mean they
> explained to me pretty much what Envers does.
I guess "auditing" is more commonly understood as storing "flat"
history, as Steve earlier mentioned; that is, you store in a single
table (or tables, the important thing is that the audit tables schema
does not depend on your schema) tuples of entity name, entity id,
field name, field value. It's more space efficient but harder to read
and rather impossible to query. But I'd like to add it as an
alternative VersionsReader, so that users can choose between the two
implementations, whatever suites them better.
>> If there would be a name change, then the old classes/annotations
>> should be deprecated, not removed - people wouldn't want to see
>> their code broken after upgrading to a newer version.
> That depends on the already existing userbase. Just deprecating the
> annotation might still
> lead to confusion since it will be available at eg code completion.
> In my opinion a clean start
> would be nicer.
As I said - so far users don't seem to be confused (or they are, but
don't show it :) ). Clean starts are nice but can anger the users ;).
Maybe in the 1.x series the @Versioned could be deprecated and the
annotation (whatever the name) preferred, and the 2.x series would
only have the new one. (Version 2.0 of Envers is where I want to add
the alternative VersionsReader implementation).
More information about the hibernate-dev