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: Extended classes
PostPosted: Fri May 13, 2005 5:24 am 
Newbie

Joined: Wed Mar 30, 2005 10:11 am
Posts: 2
Hello,

I have an abstract BillingDetails superclass and 2 classes which extend this, namely Account and CreditCard (both of these classes have further Objects mapped onto them)

A Payment class has a BillingDetails attribute.

If I run a hibernate query "find all Payments" then I get back a mixture of payments made with both Accounts and Credit Cards. However if I wish to map this payment to my DTO (yes..yes I know anti-pattern) the hibernate stub class is not an instance of either Account or CreditCard (it's a stub holder) so I can't seem to differentiate between the two for the mapping.

Just setting the billingDetails directly on the Payment object gives me the 'session no longer open' error when I try and examine the contents. (Which is true)

Must I have a 'payment_type' attribute to distinguish the two on BillingDetails? Or is there a more clever way to distinguish between the two which doesn't rely on that contrived attribute?


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.