These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: One-to-one mapping for legacy scema
PostPosted: Wed Feb 28, 2007 11:12 pm 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
I'm working with a legacy schema which has a table with a primary key which is also a foreign key to another table.

Product
=======
Id (PK)
Title

ProductQuantity
==========
Id(PK, FK)
Qty

I mapped the association as a one to one relationship but then batch fetching does not work. I need to use a lazy assosciation here because Product is stored in the 2nd level cache because the product data never changes but the quantity changes often. When I get a products collection, the quantities are retrieved one by one (A select for each quantity). I specified batching in the mapping but the batch capability apparently doesnt work for one-to-one associations.

Is there a way to map this with a many-to-one so that batching will work? Or is it a bug that batching doesnt work for the one-to-one?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.