wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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 agree. Here's the link: http://aspose.com/file-tools
subject: Hibernate Composite & foreign key, please help
Similar Threads
Legacy and Hibernate1-2-M Mapping
How make Entity with composite primary key in some other Entity's primary key?
hibenate delete problem
Hibernate one-to-on id mapping issue