-->
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: Strange problem with table per hierarchy and hascode
PostPosted: Tue Apr 12, 2005 4:50 pm 
Beginner
Beginner

Joined: Tue Dec 21, 2004 11:53 am
Posts: 42
Hello there! I have a mapping using table per class hierarchy.

I'm using fake names since I'm forbid to post real company code :(

Like hibernate in action
I have an abstract class billing details and 2 subclasses creditcard and bankacc

My user has 2 sets (I do need them to be separated)

Set creditcards
Set bankaccs

The mappings are straightforward:
<subclass
name="CreditCard"
discriminator-value="CC">
<property
name="type"
column="CREDIT_CARD_TYPE"/>
...
</subclass>

Well so far, everthing almost so good.

My credit card hashcode implementation uses the property creditCardType
My bank acc hashcode's uses property bankname

Now here comes the odd stuff. My database so far has only creditCards so the table billing_details has only
discrimitators of CC type.

But Hibernate is instantiating bankaccs even they don't exists in the table. I don't have any idea of
how hibernate implements this mapping, but at first glance it seems it's instantiating everybody and then
discarding them.....


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.