-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Is that a bug in hibernate annotations? Pl. help
PostPosted: Mon Jul 04, 2005 9:10 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
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!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 3:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you are mixing ejb3-persistence jars, in the last version targetEntity is now a Class, and not a String

Use the latest version of each jars

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 8:58 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Thanks for the response Emmanuel. I already fixed this issue by using the latest jars.


I've another requirement in our project to be able to create individual .sql dump for each of the entities (POJOs) using SchemaExport ant task. I've created a JIRA for this http://opensource.atlassian.com/project ... se/HBX-326. If this feature is implemented, it would be great.

Thanks in advance!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.