Java and JBoss related stuff
RSS icon Home icon
  • Envers 1.2.3-hibernate-3.3 – backport release

    Posted on August 21st, 2010 Adam Warski No comments

    Hernan Chanfreau backported some of the recent Envers changes and fixes from the 3.5 branch. The detailed list of the backported issues can be found in this forum post.

    I applied the patch and released a new Hibernate-3.3 compatible Envers version, it’s available in the JBoss Maven repository.

    Thanks a lot to Hernan for the work and providing the patch! :)

    Adam

  • Initial valid-time support in Envers

    Posted on July 2nd, 2010 Adam Warski No comments

    I just commited initial support for valid-time auditing in Envers, a feature that a lot of users has been (directly or indirectly) asking for. It’s joint work, as Stephanie Pau contributed a patch with a large portion of those changes – thanks!

    You can try it out by checking out Hibernate trunk source code.

    What is valid-time about? So far Envers only stored the revision at which a change was made. This information is enough to retrieve historical data, however the queries are quite complicated and in advanced use cases can be time-consuming. This can be improved when we store both the start and end revisions, that is information on when data was “valid”. For historic entities, both column are filled, and for “current” data, the end revision column is null.

    Using the valid-time audit strategy, it will be possible to:

    • speed up and simplify the queries to retrieve historical data
    • implement support for queries, which traverse relations
    • implement other types of queries, like latest changes

    To configure Envers to store the end-revision number, you have to specify a property in your configuration file:

    
    <property name="org.hibernate.envers.audit_strategy">
       org.hibernate.envers.strategy.ValidTimeAuditStrategy
    </property>
    

    Envers will then generate and additional REVEND column (next to the REV column) in every audit (_AUD) entity/table; however this column won’t be part of the primary key. You can change the name of the end-revision column by setting the org.hibernate.envers.audit_strategy_valid_time_end_name property value.

    The value of the end-revision column can be calculated basing only on the original revision-changed columns, so using a couple of queries it will be possible to easily migrate existing data to the new audit strategy.

    Please note that this feature is experimental, and can be changed in the future. The associated JIRA issue is HHH-3763.

    Adam

  • NEnvers

    Posted on July 1st, 2010 Adam Warski No comments

    If you are a .NET and NHibernate user, soon you’ll be able to use Envers in your project!

    Simon Duduica has been working on an Envers to .NET port. This is still work in progress, but you can check out the current source code here: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/sandbox/simondud/Envers.NET

    A large portion was ported, but there’s also quite a lot left, so any help is appreciated. Big thanks to Simon and looking forward to a release :)

    Adam

  • Hibernate 3.5-Final, Envers included, released!

    Posted on April 1st, 2010 Adam Warski No comments

    Hibernate 3.5 was just released; congratulations to Steve and the whole team!

    It’s the first final Hibernate release that includes Envers. You can find it both in the bundle downloadable from SF, as well as in the Maven repository.

    Happy Easter,
    Adam

  • Projects Using Envers wikipage

    Posted on February 1st, 2010 Adam Warski No comments

    I just created a new “Projects Using Envers” wikipage; so if you are using Envers in your project, make sure to add it to the list! :) If you are not yet using Envers, don’t forget to check it out when you have to implement data auditing/versioning next time.

    Also, my company, SoftwareMill, is providing Envers support and services. If you are interested in a feature being added or a bug fixed, don’t hesitate to contact us!

    Adam

  • Envers 1.2.2 released!

    Posted on December 18th, 2009 Adam Warski 4 comments

    After quite a long break, I’m happy to announce a new release of Envers (available on the downloads page, or via Maven). This is mainly a bugfix release, but there are also new features:

    • possibility to audit relations from audited to non-audited entites. This feature was actually one of the most asked for. You have to explicitly annotate such relations with @Audited(targetAuditMode=NOT_AUDITED). Then, when reading historic versions of your entities, the relation will always point to the “current” version of the entity. This is mainly useful for dictionary-type entities, which never change.
    • new configuration properties: org.hibernate.envers.default_schema and org.hibernate.envers.default_catalog with which you can specify the default catalog/schema for audit tables
    • by default, when you delete an entity, in the audit table only a “marker” entry will be written with all fields null except the id. But if you want, you can now store all data of the entity by specifying the org.hibernate.envers.store_data_at_delete property to true. This is normally not needed as the data is already stored in the last revision before the delete.
    • experimental support for “fake” bidirectional relations, mapped with @OneToMany+@JoinColumn on one side, and @ManyToOne+@Column(insertable=false, updatable=false) on the many side. Envers can now audit such relations without a middle table, but the user has to add an @AuditMappedBy annotation. See the documentation for more details.

    Also, all configuration properties were renamed from camel-case to the Hibernate standard, separating words using underscores. But don’t worry, old properties will work also. Moreover, the legacy @Versioned annotations support was removed. If somebody didn’t yet migrate, the transition should be trivial.

    This release is fully compatible with Hibernate 3.3, but remember that Envers is now a Hibernate core module, so it will be also included in the coming Hibernate 3.5 release.

    For a full list of resolved issues, see the Hibernate JIRA page.

    Thanks to Tomasz Bech, Nicolas Rouge and Eugene Goroschenya for providing patches and all other contributors and users for valuable input on the forums and in JIRA! As always, feedback is very welcome.

    Envers also has a new homepage; big thanks for the work to Rysiek, Joseph and the JBoss.ORG team!

    Merry Christmas!
    Adam

  • Envers on Jazoon

    Posted on June 21st, 2009 Adam Warski No comments

    If you’ll be attending Jazoon next week, be sure not to miss the Envers presentation! It will take place on Wednesday (24th July), at 4pm (here are the presentation details). I’ll be attending the whole Jazoon conference, so if you’d like to talk about Envers (or anything else :) ), just catch me there.

    See you in Zurich!
    Adam

  • Envers 1.2.1.GA released

    Posted on June 6th, 2009 Adam Warski 6 comments

    Yesterday I uploaded a new release of Envers, 1.2.1.GA. It is mainly a bugfix release, but there is also one new feature. You can now access the current revision entity directly using AuditReader, without the need to use a revisions listener. For details, see the description of the AuditReader.getCurrentRevision() method in the javadocs.

    You can see the list of issues closed in jira.

    The release is available for download here; it’s also in jboss’s maven2 repository.

    Have fun! :)
    Adam

  • Envers 1.2.0.GA in Maven repository; JSR308 typestate and maven plugin in GIT

    Posted on March 11th, 2009 Adam Warski No comments

    The recently released Envers 1.2.0.GA finally made it to the JBoss Maven repository; you can find it here:
    http://repository.jboss.org/maven2/org/jboss/envers/jboss-envers/1.2.0.GA-hibernate-3.3/

    Also, following Bob’s example, I’ve put the JSR 308 typestate checker and Maven2 plugin on github:

    So everyone can now easily grab the source code and modify it.

    Have fun!
    Adam

  • Envers 1.2.0.GA released!

    Posted on March 5th, 2009 Adam Warski 2 comments

    Today Envers 1.2.0.GA has been released! It is a Hibernate 3.3 compatible version of the newest Envers codebase, which will be included as a module in Hibernate 3.5. You can download it here, and find documentation here.

    The main highlights of this release are:

    • renamed “versioning” to “auditing”, so @Versioned becomes @Audited etc
    • full support for inheritance
    • support for relations in components
    • improved queries (for example possibility to add restricitions on the revision entity)

    For a full list of issues solved, see here. Special thanks to Erik-Berndt Scheper for providing valuable patches!

    The release will also be soon available through the JBoss maven repository.

    Have fun,
    Adam