File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping For CompositeID

 
mona dubey
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I am beginner for hibernate, I am not able to find proper mapping for a table containing composite ID. I am using Hibernate2 and the database is MySQL.

Here is the mapping I have done:


<composite-id>
<key-property name="year" type="java.lang.Long" column="year"/>
<key-many-to-one name="employee_id" class="com.tsystems.leavemanagement.hibernate.Employee" column="EMPLOYEE_ID"/>
<key-many-to-one name="leave_type_id" class="com.tsystems.leavemanagement.hibernate.LeaveType" column="LEAVE_TYPE_ID"/>
</composite-id>

<property
name="availed"
type="java.lang.Long"
column="AVAILED"
not-null="false"
length="11">
<meta attribute="field-description">
@hibernate.property
column="AVAILED"
length="11"
not-null="false"
</meta>
</property>
Help Urgently.
Thanks,
Mona
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic