0
<hibernate-mapping>
<class name="beans.EmployeeBean" table="employeedetails" schema="Employee">
<id name="empId" column="empid"/>
<id name="employeeusername" column="username"/>
<property name="firstname" column="firstname"/>
<property name="designation" column="designation"/>
<property name="email" column="email"/>
<property name="role" column="role"/>
</class>
</hibernate-mapping>
在當我把第二個ID的用戶名我得到錯誤,在我的數據庫也在1臺這個代碼,我把2列作爲主鍵。
你嘗試答案這裏建議:http://stackoverflow.com/questions/27642101/how-do-i-create -a-複合主鍵合冬眠-內最HBM-XML的文件 –