-->
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: Using Table Data Default
PostPosted: Thu May 14, 2009 6:11 am 
Newbie

Joined: Mon Sep 11, 2006 5:18 am
Posts: 4
Location: Bolzano (BZ), Italy
Hi,

my table foo has some columns that don't accept null values and have a data default set.
In this example, it's the column "ID_SOMEID"
Code:
<property name="idSomeId" type="string">
   <column name="ID_SOMEID" length="64" not-null="true">
   <comment>some comment</comment>
   </column>
</property>

On the table definition, it takes "0" as default value.
I got the above snippet out of Hibernate Reverse Engineering hbm file. How do I tell Hibernate it should set the POJO to table default value, when it's set to null and i'm trying to persist it? I'd like to "fire and forget" for those columns that set to "not null" and have a default value defined...

I use eclipse 3.4.1
Hibernate Tools 3.2.2.GA
Latest Java JDK (1.4 compliance) and Oracle 9i

thanks in advance
~pi4630

_________________
"Simplicity is prerequisite for reliability." (E.W. Dijkstra)


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.