-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to set default value as current date in .hbm file.
PostPosted: Wed Jun 04, 2008 12:31 am 
Newbie

Joined: Wed Jun 04, 2008 12:24 am
Posts: 3
we are passing like
<property name="modifiedDate" type="java.util.Date">
<column name="MODIFIED_DATE" length="7" default="now()"/>
</property>

But this not works.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 1:40 am 
Regular
Regular

Joined: Wed Apr 09, 2008 10:28 am
Posts: 52
maybe like this ?

Code:
<property name="modifiedDate" type="TIMESTAMP">
<column name="MODIFIED_DATE" length="7" not-null="true"/>
</property>


Top
 Profile  
 
 Post subject: How to set default value as current date in .hbm file.
PostPosted: Wed Jun 04, 2008 2:13 am 
Newbie

Joined: Wed Jun 04, 2008 12:24 am
Posts: 3
Giving error

Could not determine type for: TIMESTAMP, for columns: [org.hibernate.mapping.Column(CREATED_DATE)]


Top
 Profile  
 
 Post subject: How to set default value as current date in .hbm file.
PostPosted: Wed Jun 04, 2008 2:14 am 
Newbie

Joined: Wed Jun 04, 2008 12:24 am
Posts: 3
Giving error

Could not determine type for: TIMESTAMP, for columns: [org.hibernate.mapping.Column(CREATED_DATE)]


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