Hello, I have read the documentation on this, and searched the archives, maybe it is there but i could not find it.
I have one java class that has to be mapped to 2 differetn database tables.
Javaclass User
id
firstName
lastName
userName
password
role
this has to go to 2 tables.
DB table user
id (pk)
firstName
lastName
userName
password
DB table userRole
id (pk,fk)
userName
role
Code:
<hibernate-mapping>
<class name="SystemUserDTO" table="users">
<id name="userId" type="integer" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="firstName"/>
<property name="lastName"/>
<property name="password"/>
<property name="userName"/>
<property name="role"/>
</class>
</hibernate-mapping>
Yeah its not much but I don't know what to do after this.
I really don't get the mapping of this to the database. Most of the one-to-one relationships that I see have 2 javaclasses, so this is still just a one-to-one relationship?. I might be missing something. But if someone could help me out with this, it would be appriciated.
Thanks for you time.