sorry coz i still cant make it. i have tried to map between user_department in user table with auth_department in authorizer table. if i wrote in this way,
user.hbm.xml:
Code:
<many-to-one
name="user_department"
class="model.Authorizer"
cascade="none"
lazy="false"
update="true"
insert ="true"
unique="true"
column="DEPARTMENT"
not-null="true"
/>
authorizer.hbm.xml:
Code:
<property
name="auth_department"
type="string"
update="true"
insert="true"
>
<column
name="DEPARTMENT"
/>
</property>
<one-to-one
name="auth_department"
class="model.User"
property-ref="user_department"
/>
it will only map the sv_department with the auth_id(primary key in authorizer table).
if i wrote in this way:
user.hbm.xml:
Code:
<many-to-one
name="user_department"
class="model.Authorizer"
cascade="none"
lazy="false"
update="true"
insert ="true"
unique="true"
column="DEPARTMENT"
property-ref="auth_department"
not-null="true"
/>
authorizer.hbm.xml:
Code:
<property
name="auth_department"
type="string"
update="true"
insert="true"
>
<column
name="DEPARTMENT"
/>
</property>
<one-to-one
name="auth_department"
class="model.User"
property-ref="user_department"
/>
it will show me the error:
duplicate property mapping: department
any suggestion how to do it??? thanx.