Hi!
I use long-Datatypes for IDs. Inserting Mitspieler doesn't make a problem, but inserting a Tippgemeinschaft does:
No persister for: java.lang.Long
A Mitspieler(Player) can have several Teams (Tippgemeinschaft) to manage and a Team must have an admin.
Is my relation-mapping wrong?
Hier is my mapping file:
Code:
<class name="tippspiel.Mitspieler" table="MITSPIELER">
<id name="id" type="long" unsaved-value="null">
<column name="ID" sql-type="bigint(20)" not-null="true"/>
<generator class="native"/>
</id>
<set name="adminTippgemeinschaften" inverse="true" lazy="true" cascade="all-delete-orphan">
<key column="ADMIN_ID"/>
<one-to-many class="tippspiel.Tippgemeinschaft"/>
</set> </class>
<class name="tippspiel.Tippgemeinschaft" table="TIPPGEMEINSCHAFT">
<id name="id" type="long" unsaved-value="null">
<column name="ID" sql-type="bigint(20)" not-null="true"/>
<generator class="native"/>
</id>
<many-to-one name= "adminId" class = "tippspiel.Mitspieler" column="ADMIN_ID" not-null="true" unique="true"/> </class>
Lena