-->
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: Validating properties that are not yet set
PostPosted: Fri May 29, 2009 4:29 am 
Newbie

Joined: Fri May 29, 2009 4:02 am
Posts: 4
In the Apache Wicket framework, validation is performed before any of the properties are set on the object. When a validation error occurs, the properties are not set at all. With the current API available, validation in Wicket would be limited to using the Validator.validateValue, which can only validate constraints on properties. Is it perhaps possible to add a method to the Validator interface that accepts a set of 'properties-to-be-set'? Something like:
Code:
<T> Set<ConstraintViolation<T>> validate(T object, Map<String, Object> properties, Class<?>... groups);
or
<T> Set<ConstraintViolation<T>> validate(T object, Set<PropertyValue> properties, Class<?>... groups);


Another option would be to provide the posibillity for using a custom PropertyResolver, which would allow property values to be taken from a different source (not the object being validated), such as a map.

Best regards,
Emond Papegaaij


Top
 Profile  
 
 Post subject: Re: Validating properties that are not yet set
PostPosted: Mon Jun 22, 2009 1:51 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
this idea has been floating around but we could not come up with a satisfying API. That's something I hope providers will address and that will be standardized in the next part of the spec if needed.


Top
 Profile  
 
 Post subject: Re: Validating properties that are not yet set
PostPosted: Tue Jun 23, 2009 2:38 am 
Newbie

Joined: Fri May 29, 2009 4:02 am
Posts: 4
How are these providers going to work? I couldn't find anything about it in the current version of the spec.


Top
 Profile  
 
 Post subject: Re: Validating properties that are not yet set
PostPosted: Fri Jul 03, 2009 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
validator.unwrap(HibernateValidator.class).validateProperty(superdupperAPIHere);

check out http://people.redhat.com/~ebernard/validation/

_________________
Emmanuel


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