-->
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: @CollectionOfElements NoSuchMethodError in 3.2.0.cr2
PostPosted: Wed May 10, 2006 3:01 am 
Beginner
Beginner

Joined: Sat Apr 15, 2006 12:49 pm
Posts: 20
Location: austria
Hibernate version: core 3.2.0.cr2, ann 3.1.0.Beta10

Hi,

I just downloaded the new hibernate core 3.2.0.cr2 and get a strange error on a set annotated with @CollectionOfElements. According to the stack trace
Code:
org.hibernate.cfg.annotations.TableBinder.bind
makes a call to
Code:
org.hibernate.cfg.NamingStrategy.collectionTableName
passing in only three strings as parameter. According to http://fisheye.jboss.org/viewrep/Hibernate/trunk/Hibernate3/src/org/hibernate/cfg/NamingStrategy.java?r=9874 four strings are needed now.

regards

john

Annotated set
Code:
@CollectionOfElements(targetElement=Role.class)
@JoinTable(name="tblRoles",
   joinColumns={@JoinColumn(name="role")}
)
public Set<Role> getRoles() {
   return this.roles;
}


Stack trace

Code:
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.collectionTableName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
        at org.hibernate.cfg.annotations.TableBinder.bind(TableBinder.java:90)
        at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:769)
        at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:442)
        at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:403)
        at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
        at org.hibernate.cfg.annotations.CollectionBinder.bind(CollectionBinder.java:349)
        at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1367)
        at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:650)
        at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:326)
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:238)
        at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034)
        at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:56)
        at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:226)
        at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:45)
        at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:160)
        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.executeSortedTargets(Project.java:1216)
[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 1:36 pm 
Newbie

Joined: Wed May 10, 2006 1:05 pm
Posts: 6
Hibernate version: core 3.2.0.cr2, ann 3.1.0.Beta10


Same effect for a ManyToMany mapping if you ommit the @JoinTable annotation:

Code:
@ManyToMany
private Collection<Person> attendees;


yields the exception described by John, whereas

Code:
@ManyToMany
@JoinTable(
      name = "EventAttendees",
      joinColumns = {@JoinColumn(name = "personId")},
      inverseJoinColumns = {@JoinColumn(name = "eventId")})
private Collection<Person> attendees;


works as expected. Looks like an incompatibility in releases?

Regards
Günter


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 2:32 pm 
Newbie

Joined: Wed May 10, 2006 1:05 pm
Posts: 6
I just tried the current version of ann from SVN (r9922) and it seems to work there.


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.