-->
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.  [ 8 posts ] 
Author Message
 Post subject: JDBC insert OK, Hibernate save NOT OK.
PostPosted: Tue Jan 27, 2004 11:33 pm 
Newbie

Joined: Fri Nov 28, 2003 9:08 am
Posts: 19
Location: Brasil
Hi,

I am developping a web application for a client that has a 3rd party ERP client server application.

When I insert a Product object mapping to a tradicional JDBC connection and stmt.executeUpdate(sql);, everything goes fine.

But when I use hibernate sess.save(prod) , the object


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 6:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do you use <version> tag ? Be more specific with the error please.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 8:22 pm 
Newbie

Joined: Fri Nov 28, 2003 9:08 am
Posts: 19
Location: Brasil
tks for the reply Emmanuel....

actually I talked to the ERP


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 8:24 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There was a discussion on calendar very recently, have a look. I'm not familiar with that.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 9:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
you probably just need to use type="date" in your Hibernate mapping.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:23 am 
Newbie

Joined: Fri Nov 28, 2003 9:08 am
Posts: 19
Location: Brasil
when I put type="date", the following exception was thrown

java.lang.ClassCastException
at net.sf.hibernate.type.DateType.deepCopyNotNull(DateType.java:67)
at net.sf.hibernate.type.NullableType.deepCopy(NullableType.java:96)
at net.sf.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:212)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:871)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:817)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:740)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:717)
at br.com.tatil.rinoceronte.repositorio.RepositorioClienteBD.insereCliente(RepositorioClienteBD.java:169)


------------------------------

My map:
<property name="timestamp" column="TIMESTAMP" type="date"/>

SQL Server


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Sorry, "calendar_date"


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:21 pm 
Newbie

Joined: Fri Nov 28, 2003 9:08 am
Posts: 19
Location: Brasil
ok
it works
tks


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