DB: Oracle 9i
Hibernate Tools: 3.2.0beta8
JBoss 4.0.4
Hi!
When i start the jboss after reverseengineering i get the following error:
Code:
org.hibernate.AnnotationException: Illegal use of mappedBy on both sides of the relationship: stiwa.zde.persistence.model.AdTimebooking.adTeleworks
I have following db situation: - Table adTimebooking
- Table adTelework
- Table rt_timebooking_telework (join table), where there are only the two id-columns which identifies the composed primary key. Additional they single attributes are foreign key to the other two tables.
Two java-classes and xml-files were generated (not for the relation-table!).
The code-situation:Timebooking:Code:
@ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="adTimebookings")
public Set<AdTelework> getAdTeleworks() {
return this.adTeleworks;
}
Code:
<set name="adTeleworks" inverse="true" table="RT_TIMEBOOKING_TELEWORK">
<key>
<column name="TIMEBOOKINGID" precision="20" scale="0" not-null="true" />
</key>
<many-to-many entity-name="stiwa.zde.persistence.model.AdTelework">
<column name="TELEWORKID" precision="20" scale="0" not-null="true" />
</many-to-many>
</set>
Telework:Code:
@ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="adTeleworks")
public Set<AdTimebooking> getAdTimebookings() {
return this.adTimebookings;
}
Code:
<set name="adTimebookings" inverse="true" table="RT_TIMEBOOKING_TELEWORK">
<key>
<column name="TELEWORKID" precision="20" scale="0" not-null="true" />
</key>
<many-to-many entity-name="stiwa.zde.persistence.model.AdTimebooking">
<column name="TIMEBOOKINGID" precision="20" scale="0" not-null="true" />
</many-to-many>
</set>
How can I solve this problem (to get a correct file generation)?
I read this bug was found in former hibernate-tools-versions... now fixed at the current beta?
Thanks, Bernie