-->
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.  [ 2 posts ] 
Author Message
 Post subject: Inheritance mapping.
PostPosted: Mon Sep 18, 2006 8:29 am 
Newbie

Joined: Mon Sep 18, 2006 8:16 am
Posts: 2
I’m experiencing some problems with trying to retrieve all of my records from my DB using inheritance mapping and I was wondering if anybody could point me in the right direction.

My scenario is as follows:
I’ve got an abstract base class and three classes inheriting from my abstract base class. My mappings seem to work, I can insert records into the DB, Update and Delete the records.

However if I call the ISession.Load( AbstractBaseClass, id ) method and pass the class type as my AbstractBaseClass then this works fine and I get one of my inherited classes back. However if I try to retrieve a list of my objects by creating a criteria object with my AbstractBaseClass as the type and call ICriteria.List( ). I'm gettting an error saying that my abstract base class can’t be instantiated. Does anybody have any idea how I can retrieve a list of all my objects in one go?

Regards

Mark.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 3:16 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
What inheritance strategy are you using? Are all the inheritors coming from the same table or are you doing a joined-subclass strategy approach?
Can you show your mappings?

_________________
If this helped...please remember to rate it!


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

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.