Hi, i'm using Hibernate 3.2 rc2 and hibernate annotation.
When i'm using a OneToMany relationship with class A, B, i found it is strange that hibernate-tools generate tables: A, B and A_B!
however, i don't think table A_B is neccessary when using OneToMany. so i only create table A and B, and this causes runtime exception:
Hibernate operation: could not initialize a collection: bad SQL grammar[select ...]
nested exception is java.sql.SQLException: Table 'A_B' doesn't exist
is there anyting wrong with my annontation?
@OneToMany(targetEntity=B.class)
public List getBs() { return list; }
public void setBs(List list) { this.list=list; }
thanks!
|