-->
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: mapping sql.Timestamp and joda.DateTime different format iss
PostPosted: Thu Feb 28, 2013 11:05 am 
Newbie

Joined: Thu Feb 28, 2013 10:57 am
Posts: 1
Is there hibernate annotation to specify a difference in format between what a timestamp field is in the database and what joda.Datetime expects ?

My table has a TIMESTAMP field with format "mm/dd/yyyy HH:mm:ss PM/AM".
My corresponding entity has

@Column(name = "USER_AGREEMENT")
@Type(type = "persistent_date_time")
private DateTime userAgreement;


I get an illegalArgumentException as below, and a different timestamp format is expected.

Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-
dd hh:mm:ss[.fffffffff]
at java.sql.Timestamp.valueOf(Timestamp.java:202)
at oracle.jdbc.driver.CharCommonAccessor.getTimestamp(CharCommonAccessor
.java:460)
at oracle.jdbc.driver.OracleResultSetImpl.getTimestamp(OracleResultSetIm
pl.java:796)


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.