-
1. Re: versioning of one-to-many (on the owning side) bi-direct
adamw Aug 28, 2008 3:16 AM (in response to twisgabak)Hello,
when, you've hit the one case that doesn't yet work :)
In Envers 1.0.0.GA, a lonely @ManyToOne and a combination of @ManyToOne and @OneToMany(mappedBy="") will work.
In the current trunk version, a lonely @OneToMany or @OneToMany+@JoinTable will additionally work.
There is still the case of @OneToMany+@JoinColumn (see https://jira.jboss.org/jira/browse/ENVERS-26), which I'm working on resolving right now.
The problem here is that if you use @OneToMany or @OneToMany+@JoinTable, Hibernate (and Envers) generates a third table to store the relation data. Now, if you use @OneToMany+@JoinColumn, the foreign key is stored in the entity, to which the relation referes to (so the database mapping is identical to the one generated when using @ManyToOne or @ManyToOne+@OneToMany(mappedBy=""), however the owning side of the relation is different, which has effects on how you can use the collection).
I've uploaded the latest jars to the development section.
--
Adam