Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Incorrect joins on composite ID

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a simple parent/child relationship between two tables/objects but both tables have composite IDs. I'm able to query them but the joins are not correct.

Here are the details...

parent mapping:


child mapping:


The query that is returned:


Notice the join criteria...it's not joining the correct fields...I would have expected this query:


Even though I specified the key fields to join on...it's using the primary key(s) from the parent mapping (or so it appears.)

What am I doing wrong?

Thanks!

Hibernate version: 3.1

Name and version of the database you are using: MSSQL 2000
 
mysha ahamed
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Did u solve this problem...I also want to join on specific keys,instead hibernate joins on only primary keys..
Thnx
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic