There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • JPA mapping MAP<Entity, Embedable>
    via Stack Overflow by duykaka
  • I'm using an order column for an @OrderColumn which is also part of a foreign key like: {code}@ManyToMany @JoinTable(name = "GroupLinks", joinColumns = {@JoinColumn(name = "parent_round_id", referencedColumnName = "round_id"), @JoinColumn(name = "parent_ordinal_nbr", referencedColumnName = "ordinal_nbr")}, inverseJoinColumns = {@JoinColumn(name = "child_round_id", referencedColumnName = "round_id"), @JoinColumn(name = "child_ordinal_nbr", referencedColumnName = "ordinal_nbr")}) @OrderColumn(name = "child_ordinal_nbr") private List<Group> children;{code} As you can see the order column "child_ordinal_nbr" is also an FK (and PK) in the join table. However, this fails with a mapping exception: {code}Caused by: org.hibernate.MappingException: Repeated column in mapping for collection: com.kawoolutions.bbstats.model.Group.parents column: parent_ordinal_nbr at org.hibernate.mapping.Collection.checkColumnDuplication( at org.hibernate.mapping.Collection.checkColumnDuplication( at org.hibernate.mapping.Collection.validate( at org.hibernate.mapping.IndexedCollection.validate( at org.hibernate.cfg.Configuration.validate( at org.hibernate.cfg.Configuration.buildSessionFactory( at org.hibernate.ejb.EntityManagerFactoryImpl.<init>( at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory( ... 9 more{code} IMO there's no reason to assume the order column is not a foreign key column, too. I've posted an extensive example over at While the JPA spec is silent about this behavior there's no reason why the depicted scenario shouldn't be working.
    via by Karsten Wutzke,
    • org.hibernate.MappingException: Repeated column in mapping for collection: MarketChannelGroup.channels column: market_id at org.hibernate.mapping.Collection.checkColumnDuplication([hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    No Bugmate found.