Clicky

Spring - Repeated column in mapping for collection:

May 18, 2013

Problem:

Caused by: org.hibernate.MappingException: Repeated column in mapping for collection: xxx.xxx.xxx.xxx: ID

Cause by:

<list  name\="value"  table\="QUESTION\_VALUE"  cascade\="save-update, delete"  fetch\="join"  lazy\="true"\>
    <key column\="ID"/>
    **<index column\="ID"\></index\>**
    <one-to-many  class\="com.mkyong.common.model.QuestionValue"/>
</list\>

Solution:

  • User a field other than “ID”, in my case i created a “ORDER”  and filled its value explicity.