Joined: Wed Jul 21, 2004 5:44 am Posts: 1
|
I have a named query like
from nl.x.PObject as po where po.birthDate > :searchDate
The mapping is something like
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"file://localhost/e:/rendement/hibernate/dtd/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<class name="nl.x.PObject" table="POBJECT">
<id name="idGen" type="java.lang.Integer" column="OID">
<generator class="native" />
</id>
....
<property name="birthDate" column="BIRTHDATE" type="date" />
<query name="selectByNummerNota">
<![CDATA[select from PObject o where o.birthDate > :searchDate ]]></query>
</hibernate-mapping>
When i use query.setProperties(searchBean) and
I have a propertie in the searchBean that is of the type java.util.Date
I see that it is mapped like this in the TypeFactory of hibernate
java.util.Date.class.getName() --> Hibernate.TIMESTAMP
This gives an error with DB2:
22007 An invalid datetime format was detected; that is, an invalid string representation or value was specified.
We expected that in the method guesstype the mapping would be determined by the propertie of the hbm.xml mapping. But this is not the case we wonder WHY?
|
|