I get the following exception when using a composite id.
Can't find the proper place in the documentation to help me solve this problem.
net.sf.hibernate.MappingException: Foreign key (B [AID,BName])) must have same number of columns as the referenced primary key (A [ID])
Code:
<class name="A">
<id name="AID" type="java.lang.Integer">
<generator class="net.sf.hibernate.id.Assigned"/>
</id>
<set name="Bs" lazy="true">
<key>
<column name="AID"/>
<column name="BName"/>
</key>
<one-to-many class="B"/>
</set>
</class>
<class name="B">
<composite-id name="BID" class="BID">
<key-property name="BName" type="java.lang.String"/>
<key-property name="AID" column="java.lang.Integer"/>
</composite-id>
<many-to-one name="AName" column="AID" class="A"/>
</class>