-->
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: Default binding on a database field
PostPosted: Tue May 22, 2007 4:40 pm 
Beginner
Beginner

Joined: Fri Apr 13, 2007 9:27 am
Posts: 33
Hello all:

In the database I am working with, there is a field called "modifiedDate" in every table. There is a "Default Binding" rule on that field.
Simply, if no date is passed during create or update, the database will insert the current date and time. However, it is a non-null field. So, I cannot pass null to it. I have to pass a date or nothing at all.

How can I map it to Hibernate beans?

With default configuration, If I create a new instance and don't set the 'modifiedDate', it is null by default, and Hibernate throw an error because it is non-null field.

How can I configuer Hibernate so that it recognize that there is a default binding role?

P.S. I am using SQL Server.

Thanks


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.