Hibernate version:
3.1.2
<hibernate-mapping package="com.myvision.model">
<class name="TableModel" table="tablemodel" lazy="true">
<set name="fieldList">
<key column="parenttableModelId"/>
<one-to-many class="com.myvision.model.Field"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.myvision.model">
<class name="Field" table="field" lazy="true">
<many-to-one name="fieldType" class="com.myvision.model.FieldType" column="fieldTypeId"/>dFieldId"/>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.myvision.model">
<class name="FieldType" table="fieldtype" lazy="true">
<property name="name"/>
</class>
</hibernate-mapping>
Hello,
When i list the following query i get a list of object arrays instead of a list of objects i look for.
from TableModel tableModel join tableModel.fieldList fieldList
where
tableModel.name='Field'
or
fieldList.fieldType.name='yesNo'
The list contains object arrays of length 2. Every array contains one Field object and one TableModel object. I was hoping to get a list with tableModels.
the sql is
Hibernate:
select
tablemodel0_.id as id0_0_,
fieldlist1_.id as id3_1_,
tablemodel0_.lastModified as lastModi2_0_0_,
tablemodel0_.creationDate as creation3_0_0_,
tablemodel0_.version as version0_0_,
tablemodel0_.defaultValue as defaultV5_0_0_,
tablemodel0_.fixHeader as fixHeader0_0_,
tablemodel0_.groupBy as groupBy0_0_,
tablemodel0_.inDescriptor as inDescri8_0_0_,
tablemodel0_.name as name0_0_,
tablemodel0_.subTablesHeight as subTabl10_0_0_,
tablemodel0_.descriptorFieldId as descrip11_0_0_,
tablemodel0_.defaultQueryId as default12_0_0_,
tablemodel0_.quickSearchQueryId as quickSe13_0_0_,
fieldlist1_.lastModified as lastModi2_3_1_,
fieldlist1_.creationDate as creation3_3_1_,
fieldlist1_.version as version3_1_,
fieldlist1_.defaultValue as defaultV5_3_1_,
fieldlist1_.inDescriptor as inDescri6_3_1_,
fieldlist1_.name as name3_1_,
fieldlist1_.ordr as ordr3_1_,
fieldlist1_.showInTable as showInTa9_3_1_,
fieldlist1_.sortDown as sortDown3_1_,
fieldlist1_.fieldTypeId as fieldTy11_3_1_,
fieldlist1_.fieldCollectionId as fieldCo12_3_1_,
fieldlist1_.parentTableModelId as parentT13_3_1_,
fieldlist1_.calculatedFieldId as calcula14_3_1_
from
tablemodel tablemodel0_
inner join
field fieldlist1_
on tablemodel0_.id=fieldlist1_.parenttableModelId,
fieldtype fieldtype2_
where
fieldlist1_.fieldTypeId=fieldtype2_.id
and (
tablemodel0_.name='Field'
or fieldtype2_.name='yesNo'
)
|