Hi,
I am trying to do a @manyToMany mapping in my code and i am getting a org.hibernate.MappingException: Repeated column in mapping for collection error.
The table is I have got:
- Table PassengerSegmentVersion -primary keys {VersionStartDate, passengerID, SegmentID }
- Table PassengerLegVersion - primary keys {VersionStartDate, passengerID, SegmentID , InventoryLegID}
- Table InventoryLegVersion - primary keys {VersionStartDate, InventoryLegID }
In my PassengerSegmentVersion Class i have got :
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "PassengerLegVersion",
joinColumns = {
@JoinColumn(name = "PassengerID", referencedColumnName = "PassengerID"),
@JoinColumn(name = "SegmentID", referencedColumnName = "SegmentID"),
@JoinColumn(name = "VersionStartDate", referencedColumnName = "VersionStartDate")},
inverseJoinColumns = {
@JoinColumn(name = "InventoryLegID", referencedColumnName = "InventoryLegID"),
@JoinColumn(name = "VersionStartDate", referencedColumnName = "VersionStartDate", insertable = false, updatable = false)}
)
private List<InventoryLegVersion> inventoryLegs = new ArrayList<InventoryLegVersion>();
I have read in other topics relating to this issue to use insertable = false and updatable = false. i have tried it but still getting same error. I have not included any mapping in the InventoryLegVersion class since i don't need to use it. Do i need to do it?
Any suggestions?
Thanks in advance
Anil