Hi,
I'm wondering if there is way to join on the same table twice in a query ?
SELECT t1, t2, t3, t4, t5, t6, t7, t8
FROM
TbCollection AS t1,
TbObject AS t2
LEFT outer JOIN t2.stringValues as t3 with t3.AttributesId = 1
LEFT outer JOIN t2.stringValues as t4 with t4.AttributesId = 2
LEFT outer JOIN t2.dateValues as t5 with t5.AttributesId = 3
LEFT outer JOIN t2.stringValues as t6 with t6.AttributesId = 4
LEFT outer JOIN t2.stringValues as t7 with t7.AttributesId = 5
LEFT outer JOIN t2.stringValues as t8 with t8.AttributesId= 6
where t1.CollectionId = t2.CollectionId AND t1.DomaineCode = 123
<bag name="stringValues" table="tb_attributes_string" lazy="false">
<key column="OBJECT_ID" />
<one-to-many class="persistance.TbAttributesString" />
</bag>
Because i'm having a problem, elements from the same table have the same instance.
regards
|