Hi,
I don't know how to make a set to an other class where the target columns are in a composite-id class. The source are the columns
leagueid,name which are equal to
leagueid,teamname in the child-class. Can anybody give pointer please?
my mapping for the "parent-class" looks like this:
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"
/>
<!-- the following name represents the 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"
/>
<!-- the following name represents the playername-->
<key-property
name="name"
column="name"
type="java.lang.String"
/>
</composite-id>
...
</hibernate-mapping>
I get the Exception that the content of elemet set does not match...
Thanks in advance, Kurt