-
1. Re: support for Assocations / Relations
adamw Dec 18, 2009 10:04 AM (in response to cgs.schaefer)Hello,
auditing relations (or associations) is one of the main features of Envers. You can find a detailed description on how Envers stores and retrieves data in the documentation. For many-to-many relations, you need a join table, and Envers creates a parallel audit join table.
Adam
-
2. Re: support for Assocations / Relations
cgs.schaefer Dec 18, 2009 10:14 AM (in response to adamw)we read the dokumention here:
http://www.jboss.org/files/envers/docs/index.html
there is nothing in there how relations are handled or how mapping tables are handled.
thanks. -
3. Re: support for Assocations / Relations
adamw Dec 18, 2009 10:19 AM (in response to cgs.schaefer)There's some information here:
http://www.jboss.org/files/envers/docs/index.html#tables
Relations aren't handled in any special way, just the id of the related entity is written to the audit table.
When you read an entity that has some relations, a special proxy is created that (lazily) for each such field, which reads the related entity at the given revision, using the same algorithm as reading an entity at a given revision using the AuditReader.
Adam