Hello everyone
I need to retrieve values of dynamic-component using HQL query.
So mapping:
Code:
<class name="com.cci.isa.model.Client" entity-name="Client" table="clients" batch-size="100">
<id name="id" column="id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">clients_id_seq</param>
</generator>
</id>
....
<dynamic-component name="systemFields">
<property name="age" type="long" />
<property name="customerID" type="string" />
<property name="taxNumber" type="string" />
<property name="SCID" type="string" />
<property name="surname_rus" type="string" />
<property name="name_rus" type="string" />
<property name="middle_name_rus" type="string" />
<property name="name" type="string" />
<property name="surname_eng" type="string" />
<property name="name_eng" type="string" />
<property name="name_lat" type="string" />
<property name="org_name" type="string" />
<property name="org_name_lat" type="string" />
<property name="org_name_full" type="string" />
<property name="sex" type="string" />
<property name="resident" type="string" />
<property name="birthDate" type="date" />
<property name="obit" type="date" />
<property name="regDate" type="date" />
<property name="regCountry" type="string" />
<property name="date_liquid" type="date" />
<property name="date_beg_rel" type="date" />
</dynamic-component>
</class>
HQL query:
Code:
select clo.id, clo.systemFields['name'] from Clients clo
And SQL query generated by hibernate:
Code:
select client0_.id as col_0_0_ from clients client0_
As you see hibernate does not query dynamic-component value... How to force it to query this value?