File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate Composite & foreign key, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Composite & foreign key, please help " Watch "Hibernate Composite & foreign key, please help " New topic
Author

Hibernate Composite & foreign key, please help

Devi Sri
Ranch Hand

Joined: Dec 20, 2005
Posts: 114

Hi friends,

I need some help regarding Hibernate Composite & Foreign key.

Here is my scenario:-

I have two tables :
TableA (consisting of a primary key id1) ;
TableB (consisting of a composite primary key (id1, dtl) ) --> here , id1 is foreign key referencing id1 of TableA.

TableB can have multiple rows for each id1 of TableA.

How should I define the mapping elements, for "TableA left join TableB".

Kindly help me. I am struggling a lot , but couldn't find a solution.

Thanks in advance.


Devisri, SCJP 5.0, SCWCD 5.0
"Dream is Not what you see in sleep. Dream is that which never lets you sleep" - Abdul Kalam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Composite & foreign key, please help