one-to-many collections with identifiers are not supported
Asked on June 01, 2013
Hi All,
Need help for below error. I am using @CollectionId but got below error.
org.hibernate.MappingException: one-to-many collections with identifiers are not supported
at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:424)
at org.hibernate.persister.collection.OneToManyPersister.<init>(OneToManyPersister.java:84)
at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:316)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
Replied on June 01, 2013
Error clearly says that @CollectionId should not be used with one-to-many. You can use it with many-to-many mapping.