Folks,
I am using the following hibernate release(s)
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.ga</version>
</dependency>
Now ths bidirectional mapping usage of annotations worked in 3.2.5
Facility.JAVA
@OneToOne(cascade = CascadeType.REFRESH)
@HardOneToOne(identity = Identity.OWNER)
@JoinTable(name = "join_table_Facility_Mgr", joinColumns = @JoinColumn(name = "manager_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns =
{ @JoinColumn(name = "facility_fk", insertable = true, updatable = true, nullable = true) })
public Mgr getMgr()
{
return mgr;
}
Mgr.JAVA
@OneToOne(mappedBy = "mgr")
@HardOneToOne(identity = Identity.ASSOCIATION)
@JoinTable(name = "join_table_Facility_Mgr", joinColumns = @JoinColumn(name = "facility_fk", insertable = true, updatable = true, nullable = true), inverseJoinColumns =
{ @JoinColumn(name = "mgr_fk", insertable = true, updatable = true, nullable = true) })
public Facility getFacility()
{
return facility;
}
But in 3.2.6, it fails and the join table never gets populated properly.
The workaround might be to release the owning class from using a join table. And just populate the join table with the association side foreign key.
Anyone have any ideas why this is failing now on 3.2.6 ?
Thanks in advance
_________________ best regards
Ken
|