-->
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.  [ 1 post ] 
Author Message
 Post subject: Wrong Mapping?? java.util.Date --> Hibernate.TIMESTAMP
PostPosted: Wed Jul 21, 2004 6:09 am 
Newbie

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?


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

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.