-->
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.  [ 8 posts ] 
Author Message
 Post subject: Can you define joined-subclasses in separate mapping files?
PostPosted: Sun Oct 24, 2004 7:14 am 
Newbie

Joined: Thu Oct 21, 2004 10:45 am
Posts: 11
Hibernate version: Latest

Is it possible to define a joined-subclass in a separate mapping file to the parent class? I've got a lot of classes that all inherit from a single class, and it means putting all the mapping information into one file.

I've searched the documentation (& Google) for an answer, so apologies if this has been answered before.

TIA

Digby


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 8:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use extends=".."


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 8:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes AND remember to add the superclass BEFORE the subclasses otherwise Hibernate won't be able to resolve the extends reference properly.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Sun Oct 24, 2004 10:55 am 
Newbie

Joined: Thu Oct 21, 2004 10:45 am
Posts: 11
Thanks guys - that works a treat.

I was wondering why I couldn't define another <id> in my derived class, but thinking about it, I like the way Hibernate makes it more like Java inheritance.

Don't know if you guys are involved in the development of Hibernate, but I think it's a great product and I've only just started playing with it.

Digby


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 4:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Thank you - hope you enjoy the Hibernate experience ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Do not understand how to order mapping files
PostPosted: Sat Nov 06, 2004 4:37 pm 
Newbie

Joined: Sat Nov 06, 2004 3:58 pm
Posts: 1
i have a joined-subclass which i would like to keep in it's own mapping file and refer to it's superclass using the "extends" attribute, but when i try to run my app, it complains that it cannot find the parent class.

can you please explain what you mean by this?

i have all my mapping files in one directory, which in turn is part of my classpath. how can the order of the mapping files be specified so that it picks up the superclass BEFORE the mappings that have joined-subclasses in them?

thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 06, 2004 4:45 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Max was of course talking about the order in hibernate.hbm.xml

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 06, 2004 5:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...and you control that by either explicit stating them in a cfg.xml or do it in proper sequence when adding them to your configuration object.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.