-->
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.  [ 4 posts ] 
Author Message
 Post subject: How do I map to a column of data type date and timestamp
PostPosted: Wed Sep 14, 2005 10:57 am 
Newbie

Joined: Thu Jul 07, 2005 6:59 am
Posts: 13
Location: Derry Northern Ireland
Hi,

how do I map to these data types,

for date I am doing this,

<property name="dt" column="dt" type="java.util.Date"/>

however I get a java.lang.ClassCastException
at net.sf.hibernate.type.TimestampType.deepCopyNotNull(TimestampType.java:63)

I have looked at the documentation and followed it correctly as far as I can see,

I am using Sybase SQLAnyWhere.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 1:35 pm 
Newbie

Joined: Tue Sep 13, 2005 4:07 pm
Posts: 5
I believe you need to use the java.sql package for this.


Top
 Profile  
 
 Post subject: Re: How do I map to a column of data type date and timestamp
PostPosted: Wed Sep 14, 2005 2:51 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
squareye wrote:
Hi,

how do I map to these data types,

for date I am doing this,

<property name="dt" column="dt" type="java.util.Date"/>

however I get a java.lang.ClassCastException
at net.sf.hibernate.type.TimestampType.deepCopyNotNull(TimestampType.java:63)

I have looked at the documentation and followed it correctly as far as I can see,

I am using Sybase SQLAnyWhere.

Thanks.


How is your field defined in your Java Class ?

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 4:12 am 
Newbie

Joined: Thu Jul 07, 2005 6:59 am
Posts: 13
Location: Derry Northern Ireland
I got it working,

my field in the java class is now this,

private Date dt;

and in my mapping file,

<property name="dt" column="dt" type="timestamp"/>


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

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.