-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem using join in subclass
PostPosted: Thu Jan 25, 2007 3:45 pm 
Newbie

Joined: Thu Jan 25, 2007 3:35 pm
Posts: 2
Hi --

I'm trying to mix table per class and table per subclass mappings and I'm running into an exception when using property elements inside of the join element. I am using Hibernate 3.1.1

My mapping looks like this:


Code:
<subclass
    name="com.x.app.gdl.lists.bean.FilterListItem"
    discriminator-value="8"
>
    <join table="FilterItem" fetch="select">
        <property
             name="inputQuery"
             type="java.lang.String"
         />
         <property
             name="normalizedQuery"
             type="java.lang.String"
         />
    </join>
</subclass>


I am receiving the following errors:

17:00:56,951 ERROR main org.hibernate.util.XMLHelper$ErrorLogger - Error parsing XML: XML InputStream(186) Element "join" does not allow "property" here.
17:00:56,952 ERROR main org.hibernate.util.XMLHelper$ErrorLogger - Error parsing XML: XML InputStream(190) Element "join" does not allow "property" here.
17:00:56,953 ERROR main org.hibernate.util.XMLHelper$ErrorLogger - Error parsing XML: XML InputStream(194) Element "join" requires additional elements.

According to the example I'm following in the Hibernate 3 documentation, this shouldn't be a problem.

http://www.hibernate.org/hib_docs/v3/re ... ersubclass

Can anyone tell me what I'm doing wrong here?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 4:34 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The first element inside a <join> must be its <key>. Add that in and it'll parse.

FYI, Hibernate provides aliases for java.lang classes: you can use type="string" to improve legibility.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 6:08 pm 
Newbie

Joined: Thu Jan 25, 2007 3:35 pm
Posts: 2
Ah right...

While looking at the example, I thought it was odd that no key definition was shown and thought it might be a byproduct of the mixed mappings. Thanks for the tip, that did it.


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