Java and JBoss related stuff
RSS icon Home icon
  • 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

     

    4 responses to “Envers 1.2.2 released!” RSS icon

    • Thanks for a great work.

      We’re using envers in a healthcare project/Sweden.

      Hope to contribute back someday

    • Great to know, thanks! :)

    • where do you specify the property : org.hibernate.envers.store_data_at_delete

      Will appreciate it. If we can specify this then upon retreiving the REVTYPE.DEL you can also get to the data that was deleted rather than going to a previous revision.

      I didnt knew of this property so i have to query all the data in ascending order with respect to Id.

      After this property however even If i query this revision number I can also get the data deleted and not need to search for the second last rev for that record.

      thanks.
      Syed

    • You need to add it to the hibernate configuration file (persistence.xml or hibernate.cfg.xml)


    Leave a reply