-->
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.  [ 2 posts ] 
Author Message
 Post subject: HQL problem........
PostPosted: Fri Jun 11, 2004 11:15 pm 
Newbie

Joined: Sun Nov 30, 2003 10:09 am
Posts: 14
Hello everybody,

I have two classes:
Here is my hbm.xml file


<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="com.mislbd.iris.marketing.core.target.twmt.TerritoryWiseProductsMonthlyTargetDTO" table="TerritoryAndProductsWiseMonthlyTarget">
<id name="id" column="territorywiseProductTargetId">
<generator class="increment"/>
</id>
<property name="targetYear" />
<property name="targetMonth" />
<property name="status"/>
<many-to-one name="territoryWiseTarget" column="territoryWiseTargetId" not-null="true" />
<many-to-one name="territory" column="territoryId" not-null="true" />
<many-to-one name="createdBy" column="creatorId" not-null="false"/>
<many-to-one name="lastUpdatedBy" column="UpdatorId" not-null="false"/>
<property name="isSynchronized"/>

<list name="territoryWiseProductsTargetLines" table="TerritoryAndProductWiseMonthlyTargetLine" >
<key column="territoryWiseProductTargetLineId"/>
<index column="territoryWiseProductTargetLineIndex"/>
<composite-element class="com.mislbd.iris.marketing.core.target.twmt.TerritoryWiseProductsMonthlyTargetLineDTO">
<many-to-one name="product" column="productId" not-null="true" />
<property name="targetQuantity" />
<property name="startEffectiveDate"/>
<property name="endEffectiveDate"/>
</composite-element>
</list>

</class>

</hibernate-mapping>


This is my HQL


" SELECT twpmt.elements FROM TerritoryWiseProductsMonthlyTargetDTO twpmt inner join twpmt.territoryWiseProductsTargetLines " +
" twpmtl " +
" where twpmt.territory.id=1 and twpmt.targetYear='2004-01-01 00:00:00'" +
" and twpmt.targetMonth='1970-06-01 00:00:00' and twpmtl.product.id=49 " +
" and twpmt.status=1";


The filtered twpmtl.product.id=49 does not work. It retrives all products.
can some say why? and what the solution.
I'm using hibernate 2.1
pls Help me as soon as possible.


Best regards
Banik


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 12, 2004 1:12 am 
Newbie

Joined: Sat Aug 30, 2003 12:37 pm
Posts: 16
"twpmtl.product.id=49"

Looks like a typing error to me.

Shouldn't it be "twpmtl.productId=49" ?


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

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.