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: Date_created field value is set to NULL instead of NOW()
PostPosted: Mon Sep 21, 2009 10:32 am 
Newbie

Joined: Wed Jun 17, 2009 6:41 am
Posts: 3
Hi all,

When I use hibernate in my spring project the "NOW()" function of my "date_created" fields doesn't seem to work.
I just get a NULL value instead of the NOW() value.

When I insert a row (via my phpMyAdmin) manually it does work ok, and the date_created field gets filled with the NOW() result though.

Code:
INSERT INTO `autopermit`.`family` (
`idfamily` ,
`currently_active` ,
`date_created` ,
`date_modified`
)
VALUES (
NULL , NULL , NOW( ) ,
CURRENT_TIMESTAMP
);


The structure of the table is:
Field Type Null Default
date_modified timestamp No CURRENT_TIMESTAMP
date_created timestamp Yes NULL

Even if the HSQL query doesn't include the date_created, it still places the null value:
Hibernate: insert into autopermit.family (currently_active, date_modified) values (?, ?)

Any idea's why this might be happening?

All tips welcome,

Kind regards,

Jochen


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.