File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Databases
»
Object Relational Mapping
Author
Mapping For CompositeID
mona dubey
Greenhorn
Joined: May 27, 2005
Posts: 1
posted
Jun 01, 2005 00:21:00
0
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
I agree. Here's the link:
http://aspose.com/file-tools
subject: Mapping For CompositeID
Similar Threads
TransientObjectException while fetching data.
Getting an error when trying to insert data
Integrity constraint violation: for Hibernate Insert
Problem with Hibernate composite key mapping
Query returs empty list but getting results in TOAD
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter