-->
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.  [ 5 posts ] 
Author Message
 Post subject: mapping for current database date
PostPosted: Fri Jan 09, 2009 11:39 am 
Newbie

Joined: Tue Dec 30, 2008 6:08 am
Posts: 6
Location: India
what will be the mapping for current date in database
or any other way to implement this functionality.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 12:02 pm 
Newbie

Joined: Fri Jan 09, 2009 11:57 am
Posts: 1
You can simply include this in your code:
private Date myDate = new Date();

and skip the mapping altogether.
The only thing is, that will give you app server date, not db server date. Those, however, should be the same in most cases.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 11, 2009 3:20 am 
Newbie

Joined: Tue Dec 30, 2008 6:08 am
Posts: 6
Location: India
boristheczar wrote:
You can simply include this in your code:
private Date myDate = new Date();

and skip the mapping altogether.
The only thing is, that will give you app server date, not db server date. Those, however, should be the same in most cases.

Thanks to reply but my requirement is diffrent
perticularly i need the db date is there any way to implement it through hbm file?
thanks for your quick reply..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 4:59 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
How about: skip the mapping, and have an insert trigger populate the value in database.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 6:08 pm 
Newbie

Joined: Tue Dec 30, 2008 6:08 am
Posts: 6
Location: India
LinHib wrote:
How about: skip the mapping, and have an insert trigger populate the value in database.

Thanks LinHib, a Pseudo code will definitely help me


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