-->
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: Unexpected results in Polymorphic HQL Query
PostPosted: Thu Dec 21, 2006 11:51 am 
Newbie

Joined: Thu Jun 30, 2005 3:57 pm
Posts: 2
Hibernate version: 3.0.5

Mapping documents:

Name and version of the database you are using: Oracle 9i (9.2)


Hello,

We have the following object hierarchy (where "<-" is supposed to represent a UML gen/spec relationship):

Base <- Item <- SpecialItem
Base <- ItemAssignment

Base contains a unique identifier that is mapped as a generated id in all of our mapping files. Item and SpecialItem are mapped to different physical tables.

The ItemAssignment object contains a reference to an Item object and the physical table stores an id for a SpecialItem object. The mapping for the Item object in the ItemAssignment mapping file refers to the actual Item object, which SpecialItem extends.

The following HQL query is the source of our trouble:

select assignment.item.identifier.id from ItemAssignment as assignment

What we expect is the value stored in SpecialAssignment.identifier.id, however what we are getting back in the query is ItemAssignment.identifier.id.

This makes no sense to me and I've double/triple checked the simple query, which is identical to the one above.

Does anyone have any thoughts or suggestions on how to approach this issue?

Thanks,
John


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.