-->
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: union-subclass mapping generate wrong sql
PostPosted: Thu Jul 07, 2005 12:21 am 
Newbie

Joined: Thu Jun 09, 2005 11:11 pm
Posts: 5
Hibernate version:
3.0.5

Mapping documents:
<class
name="ru.vgroup.smt.domain.Conclusion"
lazy="false"
>

<id
name="conclusion_id"
column="conclusion_id"
type="int"
access="field"
>
<generator class="native">
</generator>
</id>

<one-to-one
name="logicalRule"
class="ru.vgroup.smt.domain.LogicalRule"
cascade="all"
outer-join="false"
constrained="false"
access="field"
property-ref="conclusion"
/>

<union-subclass
name="ru.vgroup.smt.domain.RelationConclusion"
table="relation_conclusion"
extends="ru.vgroup.smt.domain.Conclusion"
lazy = "false">

...
</union-subclass>

<union-subclass
name="ru.vgroup.smt.domain.SetAttributeConclusion"
table="set_attribute_conclusion"
extends="ru.vgroup.smt.domain.Conclusion"
lazy = "false">
...
</union-subclass>

</class>

Hibernate generate sql query with UNIONs, where it tries to select from 3! tables include super-class table. Save and Delete use concrete tables, but get/load and HQL needs super-class table. If i have empty table "Conclusion" all is fine. Hibernate doesn't need information from this table, but table must exist.

And why hibernate look for "Conclusion" table? I thought this property obligatory and can not be generated from class name.


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.