-->
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: Help! How to get "not-null" when generate hbm files?
PostPosted: Fri Oct 15, 2010 3:50 am 
Newbie

Joined: Fri Oct 15, 2010 3:42 am
Posts: 1
i use hibernate-tools and ant to generate .hbm files, but those files come out like this:
......
<property name="countryUuid" column="COUNTRY_UUID"/>
......


In fact ,the property "countryUuid" is not allowed null in database.
So what i want is like this:
.....
<property name="countryUuid" column="COUNTRY_UUID" not-null="true"/>
......


Is there any way or file to config this? I'm new in using hibernate-tools, and i need your help.

Thank you!!


Top
 Profile  
 
 Post subject: Re: Help! How to get "not-null" when generate hbm files?
PostPosted: Tue Nov 16, 2010 7:45 am 
Senior
Senior

Joined: Fri May 08, 2009 12:27 pm
Posts: 168
Make sure that the corresponding database column has a NOT NULL constraint in the first place.
At least on Oracle, reveng is picking that one up reliably.

Other than that, you can add column properties in hibernate.reveng.xml. I haven't needed that for myself, so I'd have to dig around a bit to find out what needs to be done.


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.