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.....
|
|