I have to tables, A and B, they are of 'one-to-one' relationship, that is, the PK of B(BId), is also a FK of AId.
But when I use
'hbm2hbmxml' to generate hbm.xml, in my A.hbm.xml,
I have:
Code:
<set name="fileHeaders" inverse="true">
<key>
<column name="FILE_ID" not-null="true" unique="true" />
</key>
<one-to-many class="com.cucbc.cgo.data.FileHeader" />
</set>
and in my A.java generated, I have:
Code:
public Set getB() {
return this.b;
}
public void setB(Set b) {
this.b = b;
}
Obviously, Hibernate gives me a one-to-many relationship, which is not what I want. I want a
'one-to-one' relationship, like in A.java, I want:
Code:
public B getB() {
return this.b;
}
public void setB(B b) {
this.b = b;
}
Can somebody tell me how to generate this using
Hibernate3 Ant Tool??
Thanks a lot!