Spring - Repeated column in mapping for collection:

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.
   

Comments

Popular posts from this blog

Oracle - duplicate fields in RECORD,TABLE or argument list are not permitted

Oracle - ORA-29282: invalid file ID, ORA-06512: at "SYS.UTL_FILE"