Bug: The above exception thrown when using hibernate.
Reason: This usually occurs when column name is not mentioned in many-to-many node.
The correct mapping for a many to many relation is –
<bag name="projects".... table="users_projects" > <key column="userId"/> <many-to-many column="projectId" class="Project" /> </bag>
Solution: The mapped columns should be provided in the key and many-to-many nodes as above.