-->
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: how does hibernate interpretate composite-ids?
PostPosted: Tue Nov 02, 2004 7:49 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
Hibernate version: 2.1.6

hi,
i've got a question to composite-ids ... no panic, i know how to use them ;)
Unfortunately the legacy-db has some interesting structures ...

Therefore i've got a little problem with composte-ids and my question might be a little 'strange' :)

Am i right, that hibernate tries to load an object if only some values of the composte-id are different from 'null'?
For example:
Code:
<composite-id ...>
  <key-property name="a" ..../>
  <key-property name="b" ..../>
</composite-id>

There is a value for 'a' in the db, but not for 'b' ... (a=5, b=null).
Will hibernate try to load the object?

I think hibernate tries to do this ... but will fail ... (my tests let me think this way).

Is there a possibility to configure hibernate, that an object referenced e.g. via 'many-to-one' won't be loaded if not all parts of the composite-id contains a value different from 'null'?

I now that this is a 'strange' question ... and something like that shouldn't happen ... but i've got such an similar (example is reduced to the min) situtation and need a 'nicer' solution than i have at the moment ...

thx!
curio


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.