-->
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: how to persist pojo along with sysdate for a date field
PostPosted: Wed Nov 19, 2008 2:10 pm 
Newbie

Joined: Wed Nov 19, 2008 2:04 pm
Posts: 4
Hi

I have a requirement where in i have to insert a record into db with sysdate as date column value.

I have written POJO class for the table.

now i want to store the pojo class instance along with sysdate in one of the fields of pojo.

please let me know whether it is possible in this way if not what is the alternate way.

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 7:55 pm 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
You can either:

1. initialize your field in java with new Date()
2. setup your table definition so that the field has a default of now() and leave the field as null in java


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.