Hi,
I have trouble with my set. I want to create a Set to another class.
Here are the two mappingfiles I tried to do that with:
Quote:
<hibernate-mapping package="hibernate">
<class
name="Team"
table="team"
>
<composite-id name="pk_team" class="PK_Team">
<key-property
name="leagueid"
column="leagueid"
type="java.lang.Long"
/>
<!-- teamname-->
<key-property
name="name"
column="name"
type="java.lang.String"
/>
</composite-id>
<set name="Team_Player" inverse="true" cascade="all">
<key column="leagueid"/>
<key column="teamname"/>
<one-to-many class="hibernate.Player"/>
</set>
...
</hibernate-mapping>
and the mapping of the "child-class" looks like this:
Quote:
<hibernate-mapping package="hibernate">
<class
name="Player"
table="player"
>
<composite-id name="pk_player" class="PK_Player">
<key-property
name="leagueid"
column="leagueid"
type="java.lang.Long"
/>
<key-property
name="teamname"
column="teamname"
type="java.lang.String"
/>
<!-- playername-->
<key-property
name="name"
column="name"
type="java.lang.String"
/>
</composite-id>
...
</hibernate-mapping>
Any help is greatly appreciated.
Regards,
Kurt