Solution to MySQLSyntaxErrorException: Unknown column ‘xxxxx_.elt’ in ‘field list’

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 –

Solution: The mapped columns should be provided in the key and many-to-many nodes as above.

Kj
Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.

Leave a Comment

Your email address will not be published. Required fields are marked *