-->
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: [HELP] : How to declare a timestamp column in the mapping ?
PostPosted: Wed May 26, 2004 7:36 am 
Regular
Regular

Joined: Sat May 15, 2004 4:27 am
Posts: 79
Hi all,

i am using MySQL database with hibernate. Does someone can tell
me how to declare a timestamp column in the hibernate mapping
file. At current i did that :

<property name="dateLogin" type="java.sql.Timestamp" column="date_login" not-null="true" />.

I create a java file too : Foo.java

public class ...
private Timestamp dateLogin;
....
setter/getter

This is the informations i want to insert into my table :
kurk
sdsds
127.0.0.1
127.0.0.1
2004-05-26 12:36:40

i am using session.save() method. I obtain that exceptioin :

Hibernate Exception: could not insert: [com.test.Foo]

---
Best regards

seb


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.