Hello,
Does the Criteria support dynamic-component ?
I have following codde:
Criteria criteria = session.createCriteria( MyClass.class);
criteria.addOrder(Order.asc("dynComp.String['name of field']")); // dynComp is a dynamic-component
criteria.list();
and I reveice exception:
could not resolve property: dynComp.String['name of field'] of: MyClass
I tried also others possibilities e.g. criteria.addOrder(Order.asc("dynComp.name_of_field_in_db"]));
More details
Hibernate 3.2.1
Application-Server: Tomcat 5.5
DB: mysql
hibernate file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="DataClass" table="data" abstract="true">
<id name="id" column="data_id" length="36">
<generator class="uuid">
<param name="separator">-</param>
</generator>
</id>
<discriminator column="data_class" type="string" />
<many-to-one name="Login" column="login_id" embed-xml="false" />
<property name="priority" type="integer">
<column name="priority" />
</property>
<subclass name="MyClass" discriminator-value="MyClass">
<join table="my_data">
<key column="id" />
<dynamic-component name="dynamic">
<property name="Company Name" column="company_name" type="string" />
<property name="Address 1" column="address_1" type="string" />
.
.
(more properties)
</dynamic-component>
<component name="ImportDate" class="ImportDate">
<property name="created" type="timestamp" />
<property name="updated" type="timestamp" />
<property name="removed" type="timestamp" />
</component>
</join>
</subclass>
</class>
</hibernate-mapping>
with best regards,
Rafal
|