-->
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.  [ 10 posts ] 
Author Message
 Post subject: union-subclass: can it be placed under hibernate-mapping?
PostPosted: Wed Mar 02, 2005 9:02 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Hibernate version: 3.0b4

The Hibernate reference document states that union-subclass can be
placed under the root <hibernate-mapping> element. The DTD, however,
does not include union-subclass as a valid child element of
<hibernate-mapping>. What gives?

Does the software support what's in the reference document or the DTD?

Also, while the union-subclass element does not include a subclass child
element, the tools are happy to compile subclass elements which extend
union-subclass elements. Should I believe the tool (the ddl scripts
generated seem correct)?

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 7:11 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Anyone knows the answer to the above?

I'm running out of options in trying to create a mapping for my model and
would appreciate any help.

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2005 8:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
<union-subclass> belongs below <class>

I don't believe the documentation says anything else.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2005 6:32 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Gavin,

gavin wrote:
<union-subclass> belongs below <class>

I don't believe the documentation says anything else.


Here is a quote from the document, section 5.1.14 (this is for H3b4):
Quote:
It is possible to define subclass, union-subclass, and joined-subclass mappings in separate mapping documents,
directly beneath hibernate-mapping. This allows you to extend a class hierachy just by adding a new
mapping file. You must specify an extends attribute in the subclass mapping, naming a previously mapped superclass.


I suppose this is what confused me.

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject: union-subclass: can it be placed under hibernate-mapping?
PostPosted: Mon Apr 04, 2005 7:12 am 
Newbie

Joined: Mon Apr 04, 2005 5:31 am
Posts: 3
Hi bonny

You already have a solution about this problem ?

Hi have the same problem.
The DTD not alow union-suclass, but only subclass or joined-subclass.

Code:
...

<!ELEMENT hibernate-mapping (
   meta*,
   typedef*,
   import*,
   (class|subclass|joined-subclass)*,
   (query|sql-query)*,
   filter-def*
)>
...


If you already have a solution please tell me !!!

Thanks on advance.

fgamito


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 04, 2005 7:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...this looks like an oversight...please add a failing test case to jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 4:52 pm 
Newbie

Joined: Tue Apr 12, 2005 4:00 pm
Posts: 3
A note from someone else who's been bitten by this:

The DTD was modified on 10-Apr (version 1.95), and this version appears to be what's available at http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd ... which means that your mapping file can pass a validating parser that looks to the URL, but fail when you try to load it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 1:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i dont understand. the online dtd is update and correct and i dont have any failures in using that....and besides hibernate will pickup the local dtd in your hibernatex.jar

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 8:32 am 
Newbie

Joined: Tue Apr 12, 2005 4:00 pm
Posts: 3
max wrote:
i dont understand. the online dtd is update and correct and i dont have any failures in using that....and besides hibernate will pickup the local dtd in your hibernatex.jar
-max


That's the problem: the version in the hibernate.jar is incorrect. A simple update, I agree; my post was save someone else the half hour of head-scratching when their mapping validates in their XML tool of choice (which wil llook to the web DTD) but fails when they start their app (which will look to the Jar).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 8:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well if hibernate were going online to perform its validation we would get complaints about that ;)

so yes this is a wellknown "cringe".
What I do with this (and all other dtds's) is that I use the XmlCatalog features to explicitly state which dtd I want to validate against)

_________________
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.  [ 10 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.