Hi All,
I'm trying to generate .sql files using schema export tool. I'm using the following versions.
Hibernate 3.0
Hibernate annotations 3.0 beta2
When i run the schema export, i get the following exception:
Code:
java.lang.NoSuchMethodError: javax.persistence.OneToMany.targetEntity()Ljava/lang/String;
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:848)
at org.hibernate.cfg.AnnotationBinder.processElementsOfAClass(AnnotationBinder.java:587)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:458)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:177)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:825)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:38)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
It seems that for some reason, the targetEntity method is not found in the OneToMany annotation?
I'm able to get the .sql file dump when i have a POJO which has no relationship with other entities.
Does anyone know why i'm getting this exception?
Thanks for any input in advance!