-->
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.  [ 5 posts ] 
Author Message
 Post subject: Collection of Embedable elements
PostPosted: Sat Sep 02, 2006 5:45 pm 
Newbie

Joined: Fri Jul 07, 2006 1:54 pm
Posts: 4
Hi.

Strange problem, this situation is described in reference manual, i`m doing it the same way, and look at this:

Code:
@Entity
public class Father {
   private Integer id;
   private List<Son> sons;

   @Id
   public Integer getId() {
      return id;
   }

   public void setId(Integer id) {
      this.id = id;
   }

   @CollectionOfElements
   public List<Son> getSons() {
      return sons;
   }

   public void setSons(List<Son> sons) {
      this.sons = sons;
   }
}

@Embeddable
public class Son {
   private String name;

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }
}


When creating sessionFactory:

Code:
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.collectionTableName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
   at org.hibernate.cfg.annotations.TableBinder.bind(TableBinder.java:93)


Problem is because of collection sons, so how to map this collection?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 3:40 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
wrong hibernate core version

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 3:58 pm 
Newbie

Joined: Fri Jul 07, 2006 1:54 pm
Posts: 4
emmanuel wrote:
wrong hibernate core version


wrong version? so which one should I use?

now I`m using hibernate-3.1.3 and hibernate-annotations-3.2.0.CR1

Thanks for answer.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 4:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
the core compatible version is described in the annotation reference documentation.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 4:52 pm 
Newbie

Joined: Fri Jul 07, 2006 1:54 pm
Posts: 4
emmanuel wrote:
the core compatible version is described in the annotation reference documentation.


Ok, thanks very much, I missed that information


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.