This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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


Win a copy of Android Security Essentials Live Lessons this week in the Android 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
 
 
subject: Hibernate Composite & foreign key, please help
 
Similar Threads
FOREIGN KEY
hibenate delete problem
How make Entity with composite primary key in some other Entity's primary key?
Legacy and Hibernate1-2-M Mapping
Hibernate one-to-on id mapping issue