pridkett/cvsminer — Issue #1: Fix ManyToMany mapping for CVSFileCommit and CVSTag
Author: pridkett
Created: 2011-11-21 14:51:40+00:00
State: open

When the code for CVSFileCommit.tags and CVSTag.fileCommits are both enabled the program throws the following error at runtime:

Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: persistence-unit] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:378)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at net.wagstrom.research.cvsminer.CVSMinerWeb.(CVSMinerWeb.java:49)
at net.wagstrom.research.cvsminer.CVSMinerWeb.main(CVSMinerWeb.java:42)
Caused by: org.hibernate.MappingException: Foreign key (FK2BE78CF41CDD67C9:file_cvs_commit_tag [file_cvs_commit_id])) must have same number of columns as the referenced primary key (file_cvs_commit [cvs_commit_id,file_id])
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:112)
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:95)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1835)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1756)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1423)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:282)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:366)
... 5 more

The mapping should be corrected.