Hi to all,
I have this situation:
- class Entity that's the parent - class SubEntity that's the child - class AssociatedEntity that's an object with a bi-directional association whit SubEntity (1 to N from Sub to Associated)
Into AssociatedEntity I would to use a many-to-one association with SubEntity using the property-ref:
<many-to-one name="parentEntity" class="SubEntity" fetch="select" column="NAME" property-ref="ZONE"/>
the column "NAME" is a column of the AssociatedEntity's table and "ZONE" is a column of "SubEntity".
When I fetch the parentEntity on AssociatedEntity, the framework generates this into from clause:
select.... from AssociatedEntity associatedentity0_ inner join Entity entity1_ on associatedentity0_.NAME=entity1_.ZONE and entity1_.type='SUB' left outer join SubEntity subentity1_1_ on entity1_.HINDENT=subentity1_1_.HINDENT
The problem is that ZONE isn't a column of Entity table but a column of SubEntity table.
Can anybody help me, please?
|