Either of these mappings is correct, not the use of insert="false" update="false":
Code:
<hibernate-mapping>
<class name="com.sc.mis.data.MisUser" table="MIS_USER">
<id column="USER_ID" name="id" type="long">
<generator class="net.sf.hibernate.id.TableHiLoGenerator"/>
</id>
<set name="misLocations">
<key column="USER_ID"/>
<one-to-many class="com.sc.mis.data.MisLocation"/>
</set>
<many-to-one name="misDepartment" insert="false" update="false" column="DEPARTMENT_ID"/>
<many-to-one name="misRole" insert="false" update="false" column="ROLE_ID"/>
<property column="ROLE_ID" length="18" name="roleId" not-null="true" type="long"/>
<property column="DEPARTMENT_ID" length="18" name="departmentId" not-null="true" type="long"/>
<property column="ACTIVE" length="1" name="active" not-null="true" type="byte"/>
<property column="FIRST_NAME" length="255" name="firstName" type="string"/>
<property column="LAST_NAME" length="255" name="lastName" type="string"/>
<property column="UID" length="50" name="uid" type="string"/>
<property column="PHONE" length="50" name="phone" type="string"/>
<property column="EMAIL" length="255" name="email" type="string"/>
<property column="EMERGENCY_PHONE" length="50" name="emergencyPhone" type="string"/>
</class>
</hibernate-mapping>
Code:
<hibernate-mapping>
<class name="com.sc.mis.data.MisUser" table="MIS_USER">
<id column="USER_ID" name="id" type="long">
<generator class="net.sf.hibernate.id.TableHiLoGenerator"/>
</id>
<set name="misLocations">
<key column="USER_ID"/>
<one-to-many class="com.sc.mis.data.MisLocation"/>
</set>
<many-to-one name="misDepartment" column="DEPARTMENT_ID"/>
<many-to-one name="misRole" column="ROLE_ID"/>
<property column="ROLE_ID" length="18" name="roleId" not-null="true" type="long" insert="false" update="false"/>
<property column="DEPARTMENT_ID" length="18" name="departmentId" not-null="true" type="long" insert="false" update="false"/>
<property column="ACTIVE" length="1" name="active" not-null="true" type="byte"/>
<property column="FIRST_NAME" length="255" name="firstName" type="string"/>
<property column="LAST_NAME" length="255" name="lastName" type="string"/>
<property column="UID" length="50" name="uid" type="string"/>
<property column="PHONE" length="50" name="phone" type="string"/>
<property column="EMAIL" length="255" name="email" type="string"/>
<property column="EMERGENCY_PHONE" length="50" name="emergencyPhone" type="string"/>
</class>
</hibernate-mapping>
Or you could simply remove the unnecessary roleId and departmentId properties:
Code:
<hibernate-mapping>
<class name="com.sc.mis.data.MisUser" table="MIS_USER">
<id column="USER_ID" name="id" type="long">
<generator class="net.sf.hibernate.id.TableHiLoGenerator"/>
</id>
<set name="misLocations">
<key column="USER_ID"/>
<one-to-many class="com.sc.mis.data.MisLocation"/>
</set>
<many-to-one name="misDepartment" column="DEPARTMENT_ID"/>
<many-to-one name="misRole" column="ROLE_ID"/>
<property column="ACTIVE" length="1" name="active" not-null="true" type="byte"/>
<property column="FIRST_NAME" length="255" name="firstName" type="string"/>
<property column="LAST_NAME" length="255" name="lastName" type="string"/>
<property column="UID" length="50" name="uid" type="string"/>
<property column="PHONE" length="50" name="phone" type="string"/>
<property column="EMAIL" length="255" name="email" type="string"/>
<property column="EMERGENCY_PHONE" length="50" name="emergencyPhone" type="string"/>
</class>
</hibernate-mapping>