-->
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: How to Query java.util.Map
PostPosted: Tue Mar 11, 2014 3:28 am 
Newbie

Joined: Tue Mar 11, 2014 3:14 am
Posts: 1
Here is My code:
<?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="com.dashboard.persistence.truimport.DataRow" table="TI_DATAROW" schema="core">
<id name="dataRowId" type="long">
<column name="DataRowId" />
<generator class="increment"/>
</id>

<many-to-one name="bunch" class="com.dashboard.persistence.truimport.Bunch" column="BunchId" />

<property name="lineNo" type="int" column="LineNo"/>
<property name="error" type="boolean" column="IsError"/>
<property name="warning" type="boolean" column="IsWarning"/>

<list name="prsMessageList" cascade="all-delete-orphan" lazy="false">
<key column="DataRowId"/>
<list-index column="rowIndex"/>
<one-to-many class="com.dashboard.persistence.truimport.PRSMessage"/>
</list>

<map name="dataMap" table="TI_DATAMAP" cascade="all-delete-orphan">
<key column="DataRowId"/>
<index-many-to-many class="com.dashboard.persistence.truimport.PojoProperty" column="PojoPropertyId"/>
<many-to-many class="com.dashboard.persistence.truimport.PropertyData" column="PropertyDataId"/>
</map>
</class>
</hibernate-mapping>


<?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="com.dashboard.persistence.truimport.PojoProperty" table="TI_PojoProperty" schema="core">
<id name="pojoPropertyId" type="long">
<column name="PojoPropertyId" />
<generator class="increment"/>
</id>
<many-to-one name="dataType" class="com.dashboard.persistence.truimport.DataType" column="DataTypeId"/>
<property name="name" type="string" column="Name"/>
</class>
</hibernate-mapping>

<?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="com.dashboard.persistence.truimport.PropertyData" table="TI_PropertyData" schema="core">
<id name="propertyDataId" type="long">
<column name="PropertyDataId" />
<generator class="increment"/>
</id>
<property name="value" type="string" column="Value"/>
</class>
</hibernate-mapping>

My DataRow class has a Map whose key is of type PojoProperty while value is of type PropertyData.
I need to get all DataRow whose PojoProperty='(My PojoProperty Object)' AND PropertyData.value like '%oct%'.
I tried everything in Criteria & later switched to HQL but could not found Any Solution. Plz Somebody Help.


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.