I am pretty new. All I have done so far is a simple one class one table mapping.
So I would make 2 mapping files? One for each table in the database? then using one-to-many and many-to-one reference the other tables mapping?
This is a one to one relationship. So why whould I use a one-to-many and many-to-one? This is my mapping so far. Would you mind pointing out what I have to change?
Code:
<hibernate-mapping>
<class name="com.jonathonbrozny.projmgmt.persistence.dto.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="loginId"/>
<property name="role"/>
</class>
</hibernate-mapping>
The loginId and role have to go into the userRole table along with the generated Primary Key (userId).