It looks to me like there is a bug in 2.1b6. Can someone please confirm this?
I have a map within a component. When I attempt to load my entity, I get an SQL exception: "Invalid Column Name". It appears that the SQL hibernate is generating is not including the columns from the mapping table. This works fine in 2.0.3.
Mapping section:
Code:
<class
name="com.acme.server.content.entity.ContentInfoEntity"
table="OBJECT_STACKS"
dynamic-update="true"
>
<id name="id" column="OBJECT_ID" type="string">
<generator class="com.acme.server.common.TeamsIdGenerator"/>
</id>
<component
name="contentInfo"
class="com.acme.content.ContentInfo"
insert="false"
update="true"
>
<property name="name" column="OBJECT_NAME" type="string"/>
<property name="contentSize" column="CONTENT_SIZE" type="java.lang.Long"/>
<property name="contentKind" column="CONTENT_KIND" type="string"/>
<property name="mimeType" column="MIME_TYPE" type="string"/>
<property name="contentPath" column="OBJECT_NAME_LOCATION" type="string"/>
<property name="status" column="STATUS" type="string"/>
<property name="encoding" column="OBJECT_ENCODING" type="string"/>
<property name="unitOfSize" column="UNIT" type="string"/>
<component
name="storageManagerId"
class="com.acme.entity.TeamsIdentifier"
insert="false"
update="false"
>
<property name="teamsId" column="STORAGE_MANAGER_ID" type="string"/>
</component>
<map
name="storageAttributesMap"
table="CONTENT_OBJECT_STORAGE_ATTR"
lazy="true"
outer-join="true"
>
<key column="OBJECT_ID"/>
<index column="ATTR_NAME" type="string"/>
<element column="ATTR_VALUE" type="string"/>
</map>
</component>
</class>
Hibernate SQL:
Code:
Hibernate: select this.OBJECT_ID as OBJECT_ID0_, this.OBJECT_NAME as OBJECT_N2_0_, this.CONTENT_SIZE as CONTENT_3_0_, this.CONTENT_KIND as CONTENT_4_0_, this.MIME_TYPE as MIME_TYPE0_, this.OBJECT_NAME_LOCATION as OBJECT_N6_0_, this.STATUS as STATUS0_, this.OBJECT_ENCODING as OBJECT_E8_0_, this.UNIT as UNIT0_, this.STORAGE_MANAGER_ID as STORAGE10_0_ from OBJECT_STACKS this, CONTENT_OBJECT_STORAGE_ATTR storagea1_ where this.OBJECT_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and this.OBJECT_ID=storagea1_.OBJECT_ID(+)