-
1. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
adamw Feb 23, 2010 10:37 AM (in response to flexpert)Ah, the problem here is that the relation is in fact held in table B (it has a column A_id or sth like that), so if B is not audited, there's no place where the information could be held. I only used relations in the other direction and then it works.
Here a special join table would be probably needed. But for now it won't work. If you can, please open a JIRA feature request.
Adam
-
2. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
cbourque1 Aug 2, 2010 9:30 PM (in response to adamw)Is there a fix for that problem?
-
3. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
adamw Aug 21, 2010 11:27 AM (in response to cbourque1)Well there are three possibilities: either audit both entities, use a join table to hold the relation or write a patch to store the audit in a join table in this special case
Adam
-
4. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
cbourque1 Aug 21, 2010 2:56 PM (in response to adamw)Thanks Adam!
-
5. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
ibenjes Jun 2, 2011 11:08 AM (in response to flexpert)Hi,
what is the status on this one? I just came accross it on the first entity I've enabled for auditing but if OneToMany relationships to not-audited entities isn't working then this kills envers for me unfortunately. I have a lot of these relationships where the other side doesn't have to be audtited and I can't rewrite them all to use join tables.
I am using envers 1.2.2.ga for hibernate 3.3.
Btw. is there any way for envers to create the audit tables automatically even if hbm2ddl.auto is not used? I don't want to use hbm2ddl.auto=create/update in production but would still like to have envers create the audit tables automatically.
-
6. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
adamw Jun 2, 2011 11:32 AM (in response to ibenjes)It works, but you'll have to use a newer Envers version I'm afraid.
As for schema generation, hbm2ddl.auto is currently the ony way.
Adam
-
7. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
ibenjes Jun 2, 2011 3:52 PM (in response to adamw)Hi Adam,
just found the 1.2.3 release for Hibernate 3.3 on your blog
http://www.warski.org/blog/?p=257
Is it fixed in that version?
Thanks
Immo
-
8. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
adamw Jun 3, 2011 9:29 AM (in response to ibenjes)Looking at the list at the blog post, it's not there, but I really don't have such a good memory to remember what was in each release .
But I would really recommend upgrading, there was Hibernate 3.5 and 3.6 meanwhile, and now Hibernate 4.0 is coming.
Adam
-
9. Re: RelationTargetAuditMode.NOT_AUDITED and @OneToMany
ibenjes Jun 3, 2011 9:46 AM (in response to adamw)Upgrading isn't always that easy when you have something running in production. We are using Seam 2.2 as the framework and seam bundles it's choice of hibernate. I could try replacing the hibernate jars but that would need testing and testing.