Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Composite & foreign key, please help  RSS feed

Devi Sri
Ranch Hand
Posts: 115
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!