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
|