Dear all.
I am quite a hibernate beginner, so please excuse if my question seems simple.
I have the following mapping:
Code:
<class name="User" table="users">
<id name="uid" column="uid">
<generator class="native" />
</id>
<join table="server">
<key column="uid" unique="true" />
<many-to-one name="server"
class="ServerName" column="serverId" not-null="true" />
</join>
</class>
<class name="ServerName" table="serverNames">
<id name="serverId" column="serverId">
<generator class="native" />
</id>
</class>
So I have three tables:
Code:
table users ( uid bigint not null primary key )
table server ( uid bigint not null primary key, serverId bigint not null )
table serverNames ( serverId bigint not null primary key )
All works fine, I can instantiate the appropriate classes, no problems so far. But now I have some understanding problem. How can I update the table "server", i.e. I want to asign another serverId to a given uid, i.e. I want to update the join table... how can I access the join table and update it via hibernate?
How you can help me, thanks in advanced,
greetings,
Norman[/code]