-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HQL retrieve map values
PostPosted: Tue May 22, 2012 2:50 am 
Newbie

Joined: Tue May 22, 2012 2:33 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.