Wise gurus of hibernate!
I have set up a many-to-many relation between 2 simple classes (and autogenerate my mappings with xdoclet), yet when hibernate runs, it says this:
org.hibernate.MappingException: Foreign key (FKB307E1191A5ADD70:events [fk_report])) must have same number of columns as the referenced primary key (reports [fk_event,fk_report])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:90)
The mirrored index tables for each class look like this (MySQL).
events_reports:
fk_event, fk_report, PRI
reports_events:
fk_report,fk_event, MUL
In my report class I have this annotation:
/**
* @hibernate.set role="events" cascade="save-update" inverse="true" lazy="true"
* @hibernate.collection-key column="fk_report"
* @hibernate.collection-many-to-many column="fk_event" class="mil.darpa.tn.model.EventModel"
* @return
*/
public Collection getEvents() {
return events;
}
And in my event class I have the reverse:
/**
* @hibernate.set role="reports" cascade="save-update"
* @hibernate.collection-key column="fk_event"
* @hibernate.collection-many-to-many column="fk_report" class="mil.darpa.tn.model.ReportModel"
* @return
*/
public Collection getReports() {
return reports;
}
Any tips? I researched this issue and found nothing recent.
Thank you!!
Darren
|