Use the following mapping files
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Category" table="Category">
<id name="CategoryID" column="CategoryID"/>
<property name="name" column="name"/>
</class>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="MinutesBag" table="MinutesBag">
<id name="MinutesBagID " column="MinutesBagID "/>
<property name="minutes " column="Minutes "/>
<property name="description " column="Description "/>
</class>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="CategoryMinutesBag" table="CategoryMinutesBag">
<composite-id name="catgMinutesBagPK" class="CatgMinutesBagPK">
<key-many-to-one name="category" class="Category">
<column name="CategoryID"/>
</key-many-to-one>
<key-many-to-one name="minutesBag" class="MinutesBag">
<column name="MinutesBagID"/>
</key-many-to-one>
</composite-id>
<property name="propA" column="PropA"/>
<property name="propB" column="PropB"/>
</class>
Remember for the third mapping file you need to have additional Java class CatgMinutesBagPK which implements Serializable interface. Also override equals() and hashcode() methods in this Primary Key class. For help use EqualsBuilder and HashcodeBuilder from commons-lang library.
HTH,