This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Composite & foreign key, please help " Watch "Hibernate Composite & foreign key, please help " New topic

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Hibernate Composite & foreign key, please help
It's not a secret anymore!