- This topic has 2 replies, 2 voices, and was last updated 16 years, 5 months ago by Loyal Water.
-
AuthorPosts
-
DISMemberI’m using JPA with MySql and toplink. When I try to ‘generate entities and daos’ i get the following error. I’m using a pulse config ‘MyEclipse 6.5 – Pulse Edition’ if that helps any. I was running this with success until I made changes to my db structure. I am using a link table to implement a many to many between to of my tables. I think I’ve named things according to the JSR 220: Enterprise JavaBeansTM,Version 3.0 Java Persistence API specification. That was when the trouble began. Any ideas?
Also, what is the easiest way to change my config to use hibernate with my jpa instead of toplink? I can’t see for looking.
Thanks
!ENTRY org.eclipse.core.jobs 4 2 2008-08-10 02:26:30.625
!MESSAGE An internal error occurred during: “Generating Artifacts”.
!STACK 0
java.lang.NullPointerException
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:77)
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:73)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1263)
at org.hibernate.cfg.JDBCMetaDataConfiguration.secondPassCompileForeignKeys(JDBCMetaDataConfiguration.java:33)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:878)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:91)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:858)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:405)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
DISMemberOk, I have it working but I think the npe should not happen and yes I know it is coming from hibernate.
There were a number of things I had to do.
-) The two tables in the manytomany had to have foreign keys specified using the referrer table
-) The referrer table itself had to have a primary key
-) I had to manually remove obsolete entries from persistence.xmlMaybe that will help someone else
Loyal WaterMemberThank you for posting this information Im sure it would be helpful to the other users facing similar issues on the forums.
-
AuthorPosts