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
|
|