-->
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: using spring annotations for validating
PostPosted: Tue Apr 20, 2010 7:51 am 
Newbie

Joined: Wed Mar 11, 2009 5:13 pm
Posts: 4
Hi,
is it possible to validate Objects that are annotated with spring specific annotations with hibernate validator. Is it possible that it can handle a @org.springmodules.validation.bean.conf.loader.annotation.handler.NotNull annotation?
Code:
   /**
    * Checks whether the specified annotation is a valid constraint annotation. A constraint annotations has to
    * fulfill the following conditions:
    * <ul>
    * <li>Has to contain a <code>ConstraintValidator</code> implementation.</li>
    * <li>Defines a message parameter.</li>
    * <li>Defines a group parameter.</li>
    * <li>Defines a payload parameter.</li>
    * </ul>
    *
    * @param annotation The annotation to test.
    *
    * @return <code>true</code> if the annotation fulfills the above condtions, <code>false</code> otherwise.
    */
   public boolean isConstraintAnnotation(Annotation annotation)

in ConstraintHelper... it's not possible because they are no valid constraint annotation, is this true?

Thanks


Top
 Profile  
 
 Post subject: Re: using spring annotations for validating
PostPosted: Fri Apr 23, 2010 8:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
No, it is not possible to validate Spring specific annotations with Hibernate Validator. As you pointed out in your post Hibernate Validator checks whether an annotation is a JSR 303 compliant annotation. It only validates these type of constraints.
I am not sure what usecase you are trying to solve. If you are building a new application then I believe that the Spring now also supports Bean Validation.

--Hardy


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.