-
Envers 1.1.0.beta2 released with collections support
Posted on September 27th, 2008 2 commentsToday Envers 1.1.0.beta2 has been released. This release focuses on supporting persistent collections. In earlier versions, it was only possible to version collections belonging to one-to-many bidirectional relations. Right now Envers supports (almost: see here which and why) all persistent collections supported by Hibernate:
- one-to-many uni- and bi-directional
- many-to-many uni- and bi-directional
- sets and indexed lists of “simple” types, like strings, numbers, etc.
- various maps (mapped with
@MapKey,@MapKeyManyToMany, …)
Moreover, there is preliminary support for custom user types. Please test! :) Detailed release notes can be found here.
You can head straight to the downloads, and then, if you have any problems or questions, to the forums.
I’ve also pushed 1.1.0.beta2 to JBoss’s Maven2 repository, and 1.0.0.GA made it to the central maven repository.
Enjoy!
Adam -
Envers on Herbstcampus 2008
Posted on September 19th, 2008 No commentsYesterday I came back from Herbstcampus 2008 in Nürnberg. I gave there a talk on Envers. Thanks to all who attended! I’d also like to thank the organisers, everything went smoothly and I felt really welcome there :).
You can find the slides here. They lack of course the added value of “live comments”, but if you’ve got any questions, please write on the forum.
Adam
-
Envers is back from vacations
Posted on September 3rd, 2008 11 commentsHello,
after a vacation break, Envers is back with a 1.1.0.beta1 release. You can find the release notes here.
There’s quite a lot of changes and improvements in this release. Firstly, Envers now only works with Hibernate 3.2.6 or Hibernate 3.3.0. That is because support (not yet complete) for persistent collections is added – and that requires collection event listeners, which were introduced in Hibernate 3.2.6.
However, thanks to the new listeners, you can now version many-to-many relations and unidirectional one-to-many relations (except for the mapping
@OneToMany+@JoinColumn, which will be supported later).Other improvements include:
- a configuration option (
org.jboss.envers.unversionedOptimisticLockingField) to automatically unversion fields in entities annotated with @Version, contributed by Nicolás Doroskevich - an
@Unversionedannotation, which lets you exclude some fields from versioning, while keeping the entity-wide @Versioned annotation, contributed by Sebastian Komander - a new implementation of the query system, which provides room for future improvements
- the revisions-of-entity query returns now by default a list of triples: the entity that was modified, revision entity containing all revision data and the revision type (see the beta javadoc for details); all this is read using only one database query; there are also slight API changes in version queries
- for Maven2 users, Envers is now deployed to JBoss’s repository, http://repository.jboss.org/maven2/org/jboss/envers/jboss-envers/.
I’d like to welcome and thank two new contributors: Nicolás and Sebastian. Don’t hesitate to follow their way :). As always, all forum users were very helpful in finding bugs and suggesting new ideas.
Finally, some updates on configuration. The Envers home page doesn’t yet reflect this (as it’s still a beta release). To use the new collection listeners, be sure that your
persistence.xmlincludes the following:<property name="hibernate.ejb.event.post-insert" value="org.jboss.envers.event.VersionsEventListener" /> <property name="hibernate.ejb.event.post-update" value="org.jboss.envers.event.VersionsEventListener" /> <property name="hibernate.ejb.event.post-delete" value="org.jboss.envers.event.VersionsEventListener" /> <property name="hibernate.ejb.event.pre-collection-update" value="org.jboss.envers.event.VersionsEventListener" /> <property name="hibernate.ejb.event.pre-collection-remove" value="org.jboss.envers.event.VersionsEventListener" /> <property name="hibernate.ejb.event.post-collection-recreate" value="org.jboss.envers.event.VersionsEventListener" />
Or if you are using Envers directly with Hibernate:
<event type="post-insert"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event> <event type="post-update"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event> <event type="post-delete"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event> <event type="pre-collection-update"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event> <event type="pre-collection-remove"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event> <event type="post-collection-recreate"> <listener class="org.jboss.envers.event.VersionsEventListener"/> </event>
If you are using Envers with JBoss AS 4.2.x, you’ll have either to bundle the hibernate jars with your application, or upgrade hibernate in the
libdirectory of the AS, as the versioned used there is 3.2.4.SP1.As always, waiting on the forums for your opinions and for bug reports in JIRA.
Adam
- a configuration option (

