reset password
Author Message
nahmed5
Posts: 57
Posted 20:09 Feb 10, 2015 |

Hi, I'm not understanding this error that I'm getting. What is Repeated column in mapping for collection? Any idea?

 

Caused by: org.hibernate.MappingException: Repeated column in mapping for collection: gefp.model.Cell.checkpoints column: id
    at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:341)
    at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:364)
    at org.hibernate.mapping.Collection.validate(Collection.java:321)
    at org.hibernate.cfg.Configuration.validate(Configuration.java:1331)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1789)
    at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
    ... 40 more

hgadhia
Posts: 52
Posted 20:13 Feb 10, 2015 |

This is probably because, in your Cell class, you have specified multiple properties (Columns names) with same name i.e. id.

Make sure all the properties has different column name annotations.

Last edited by hgadhia at 20:19 Feb 10, 2015.
nahmed5
Posts: 57
Posted 14:09 Feb 11, 2015 |

I think I  had because I mapped a table 1:N but in database I inserted values as M:N. Once I changed it, it worked. But at that moment, I just couldn't debug it. However, thanks for Ur suggestion.