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

Hibernate - HibernateException: createQuery is not valid without active transaction