Select by Criteria on Date field doesn't work anymore.
My test case is :
- Select an existing Evenement Object by Date Field And Id
Code:
<class
name="com.orange.greco.persistance.dao.fiche.bean.EvenementTO"
table="EVENEMENT"
>
<id
name="idEvenement"
type="java.lang.Integer"
column="ID_EVENEMENT"
>
<generator class="sequence">
<param name="sequence">SEQEVE00</param>
</generator>
</id>
<property
name="datecreation"
type="java.util.Date"
column="DATECREATION"
not-null="true"
length="7"
/>
...
</class>
Code:
Criteria lookupCriteria = getHibernateTemplate().createCriteria(getSession(), EvenementTO.class);
lookupCriteria.add(Expression.eq("idEvenement",<EXISTING_ID_EVENEMENT>);
lookupCriteria.add(Expression.eq("datecreation",<EXISTING_DATE_CREATION>);
List results=lookupCriteria.list();
return results;
EXISTING_DATE_CREATION is the exact same java.util.Date object used for the creation of the Evenement Object that I try to select.
And select is always blank...
I have seen problems concerning handling of java.sql.timeStamp and TIMESTAMP sql type in Oracle 9i but It doesn't seem to apply to me as I use java.util.Date for Hibernate Mapping and DATE for the sql column type