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?