-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate XML persistence - how to store date through xml
PostPosted: Wed Feb 22, 2006 2:53 am 
Newbie

Joined: Wed Feb 22, 2006 2:43 am
Posts: 1
Hi,

I am trying to store date through xml using hibernate xml persistence.

But i am getting following error -

org.hibernate.HibernateException: could not parse XML
at org.hibernate.type.DateType.fromStringValue(DateType.java:95)
at org.hibernate.type.NullableType.fromXMLString(NullableType.java:102)
at org.hibernate.type.NullableType.fromXMLNode(NullableType.java:126)
at org.hibernate.property.Dom4jAccessor$ElementGetter.get(Dom4jAccessor.java:192)
at org.hibernate.tuple.AbstractTuplizer.getPropertyValues(AbstractTuplizer.java:174)
at org.hibernate.persister.entity.BasicEntityPersister.getPropertyValues(BasicEntityPersister.java:2929)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:84)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at updatedb.DBUploder.uploadDB(DBUploder.java:77)
at updatedb.DBUploder.main(DBUploder.java:219)
Caused by: java.text.ParseException: Unparseable date: "20 December 2005"
at java.text.DateFormat.parse(DateFormat.java:335)
at org.hibernate.type.DateType.fromStringValue(DateType.java:92)

Please tell what format i shoul use for date?
In class file i am using java.util.date for data variable
and in hbm.xml i am using type="date".


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 4:24 am 
Beginner
Beginner

Joined: Wed Aug 04, 2004 4:33 am
Posts: 45
Location: Switzerland
Did you try to write java.util.Date also in the hbm.xml file? I remember having something like this and it helped, but has been a few month ago.
And it's capital D but I guess you know this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.