-->
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: HQL and Joined-Subclass interpretation problem
PostPosted: Thu Mar 10, 2005 9:44 pm 
Newbie

Joined: Wed Nov 12, 2003 4:57 pm
Posts: 14
Location: New York City
Hibernate version: 2.8
Name and version of the database you are using: MySql 4.0.21

Mapping documents:
Here are the important parts:
Code:

<hibernate-mapping package="com.ch.edb.product.domain">
<class name="Product" table="Product">
     <id name="productId" column="product_id" type="long" unsaved-value="0">
     <generator class="native"/>
     </id>

...

<joined-subclass name="com.ch.edb.product.video.domain.Video" table="VideoProduct">
     <key column="product_id"/>   
...

</joined-subclass>
...

<joined-subclass name="com.ch.edb.product.videogame.domain.VideoGame" table="VideoGameProduct">
     <key column="product_id"/>
</joined-subclass>

</class>
</hibernate-mapping>



I have a problem when doing an HQL query. The following is the query:

Code:
from com.ch.edb.product.video.domain.Video v
where v.clearanceRequired='Y'
and v.title like :title
and v.studio = :studio
and v.clearance.clearedCanada='N'
and v.clearance.clearedQuebec='N'
and v.clearance.clearedUS='N'


The problem is that in the stack trace, hibernate shows me an error and prints out the hql where the error takes place. The hql printed out is this:

Code:
from com.ch.edb.product.videogame.domain.VideoGame v
where v.clearanceRequired='Y'
and v.title like :title
and v.studio = :studio
and v.clearance.clearedCanada='N'
and v.clearance.clearedQuebec='N'
and v.clearance.clearedUS='N'


It seems that hibernate has changed
Code:
com.ch.edb.product.video.domain.Video
to
com.ch.edb.product.videogame.domain.VideoGame.


If I comment out the VideoGame joined-subclass, the query works fine. Did I perhaps find a bug with the hql parser?


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.