-->
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: Constraint on more columns
PostPosted: Tue Jan 26, 2010 4:02 am 
Newbie

Joined: Mon Jan 25, 2010 10:39 am
Posts: 4
Hi all,
is there any possibility to make constraint annotation or something similar on more than one column.
Here is my problem:
I have one table with some columns and i want to be sure that user fill only one column, not more and not less than one. Is there possilbility to make it with Hibernate annotations?
Thanks for your ideas
With regards Michal


Top
 Profile  
 
 Post subject: Re: Constraint on more columns
PostPosted: Tue Jan 26, 2010 4:35 am 
Newbie

Joined: Mon Jan 25, 2010 10:39 am
Posts: 4
Sorry for duplicate entry (problem with internet connection) and we are using hibernate 3.3.


Top
 Profile  
 
 Post subject: Re: Constraint on more columns
PostPosted: Tue Jan 26, 2010 6:03 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Check out what you can do with Hibernate Validator: http://docs.jboss.org/hibernate/stable/ ... e/en/html/

I have not used it myself, but it sure looks like it should be able to do what you want. The built-in validation rules seems to work on single properties only, so you may have to implement your own validator, but it seems to be a rather simple task.


Top
 Profile  
 
 Post subject: Re: Constraint on more columns
PostPosted: Tue Jan 26, 2010 9:09 am 
Newbie

Joined: Mon Jan 25, 2010 10:39 am
Posts: 4
Thnx for your reply. I know about validator but i was hoping that there is something built-in. Nevermind i think validator can solve my problem.
Thnx again.
Michal


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