Hi everyone,
I have a problem with a query. I have a criteria which return a list of one object (in this case) but this object is Null. I dont understand what is the problem so I need your help.
Here is my java code :
Code:
Criteria criteria = session.createCriteria(Tdinv700.class)
.add(Restrictions.eq("id.item", sItem))
.add(Restrictions.eq("id.orno", iOrderNumber))
.addOrder(Order.asc("id.trdt"));
List list = criteria.list();
And here is my mapping :
Code:
<class name="com.mk.tdinv.Tdinv700" table="VW_TDINV700" schema="ADMINISTRATOR">
<composite-id name="id" class="com.mk.tdinv.Tdinv700Id">
<key-property name="item" type="string">
<column name="ITEM" length="40" />
</key-property>
<key-property name="cwar" type="string">
<column name="CWAR" length="3" />
</key-property>
<key-property name="trdt" type="date">
<column name="TRDT" length="10" />
</key-property>
<key-property name="trtm" type="java.lang.Integer">
<column name="TRTM" />
</key-property>
<key-property name="sern" type="java.lang.Integer">
<column name="SERN" />
</key-property>
<key-property name="quan" type="java.lang.Double">
<column name="QUAN" precision="53" scale="0" />
</key-property>
<key-property name="kost" type="java.lang.Short">
<column name="KOST" />
</key-property>
<key-property name="koor" type="java.lang.Short">
<column name="KOOR" />
</key-property>
<key-property name="orno" type="java.lang.Integer">
<column name="ORNO" />
</key-property>
<key-property name="pono" type="java.lang.Integer">
<column name="PONO" />
</key-property>
<key-property name="rlcd" type="string">
<column name="RLCD" length="6" />
</key-property>
<key-property name="cprj" type="string">
<column name="CPRJ" length="6" />
</key-property>
<key-property name="prst" type="java.lang.Short">
<column name="PRST" />
</key-property>
<key-property name="exre" type="string">
<column name="EXRE" length="6" />
</key-property>
<key-property name="schno" type="string">
<column name="SCHNO" length="10" />
</key-property>
<key-property name="mitm" type="string">
<column name="MITM" length="40" />
</key-property>
<key-property name="mcwar" type="string">
<column name="MCWAR" length="3" />
</key-property>
<key-property name="opro" type="java.lang.Short">
<column name="OPRO" />
</key-property>
<key-property name="ddate" type="date">
<column name="DDATE" length="10" />
</key-property>
<key-property name="dttren" type="date">
<column name="DTTREN" length="10" />
</key-property>
<key-property name="tmtren" type="java.lang.Integer">
<column name="TMTREN" />
</key-property>
<key-property name="ustren" type="string">
<column name="USTREN" length="10" />
</key-property>
</composite-id>
</class>
Thanks in advance for any help
Hugues