-->
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: Troble with polymorphic Criteria query
PostPosted: Thu May 31, 2007 3:36 am 
Newbie

Joined: Wed May 30, 2007 11:02 am
Posts: 1
I have Subclass1 and Subclass2, that are members of parent Superclass.

<class name="Superclass" ...>
<joined-subclass name="Subclass1".../>
<joined-subclass name="Subclass2".../>
</class ...>

While creating for Subclass2 (or Subclass1) a query Criteria based on Superclass: createCriteria(Superclass.class ), I get an objects of Subclass2 with not initialized Subclass2's properties, but inherit Superclass's properties are ok

However if i create same query but based on Subclass2: createCriteria(Subclass2.class )
then all properties are initialized properly. Same result we have if to use HQL (createQuery("from Superclass")


i've made an experiment with mappings:
i've swithed over joined-subclass definitions for Subclass1 & Subclass2 (see below)

Before:
<class name="Superclass" ...>
<joined-subclass name="Subclass1".../>
<joined-subclass name="Subclass2".../>
</class ...>
After
<class name="Superclass" ...>
<joined-subclass name="Subclass2".../>
<joined-subclass name="Subclass1".../>
</class ...>

In this case Subclass2's properties are initilized fine

By the way, those problem properties of Subclass2 named identically to custom properties of Subclass1, but different types

Please, tell what's problem.

Sorry for bad english i'm from russia. Village Gadjukino


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.