First, thank you.
Jamie you are right, the classnames are not good. But this is not my system. I just wanted to demonstrate that it is a good idea to use hibernate for such a "system". I hope i'll enlightend to prove that statement :)
Let me clarify:
In my class
KAMemberSongs.musicfile
shall a
KARealaudio be stored.
Every KAMemberSongs-Instance has exactly one KARealaudio-Instance in the field musicfile. The tupels are linked with: KAMemberSongs.song_id -> KARealaudio.id
Wuah, in the moment i wrote this and thought about your hints, i got it!!
Its just easy!
Here is my correct definition:
Code:
<class name="KAMembersSongs" table="ka_members_songs">
<id name="id" column="id">
<generator class="native"/>
</id>
<!-- THIS MUST BE COMMENTED OUT -->
<!-- property name="songId" column="song_id"/ -->
<many-to-one name="musicfile"
class="KARealaudio"
unique="true"
column="song_id"
not-null="true"/>
</class>
<class name="KARealaudio" table="ka_realaudio">
<id name="id" column="id">
<!-- generator class="native"/ -->
<generator class="native"/>
</id>
<property name="dateiBuy" column="datei_buy" />
</class>
I really had to delete the son_id definition. I hope i will get i through a setter anyway.
Well, thank you very much! Hope this thread will help others.
CHeers
Chris