Hello, I've used hibernate tools to reverse engineer an oracle 10g database. It has generated java classes for every tables as expected, but when i try launch my program, i get a Duplicate Mapping Exception. There is a single, generated, hbm.xml file for each classes and there are no annotations. What could the problem be?
Quote:
févr. 17, 2015 6:00:17 PM org.hibernate.cfg.Configuration$MappingsImpl addImport
INFO: HHH000071: Duplicate import: Genre -> Genre
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:19)
at Main.main(Main.java:12)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource Genre.hbm.xml
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3819)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3808)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3796)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
at HibernateUtil.<clinit>(HibernateUtil.java:17)
... 1 more
Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping Genre.films
at org.hibernate.cfg.Configuration$MappingsImpl.addCollection(Configuration.java:2908)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2249)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2224)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:412)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:327)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:178)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3816)
... 6 more
Thanks
-Philippe