Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Dev List »

[hibernate-dev] [HV] Ability to apply constraint on elements of an
 Iterable instance

Hardy Ferentschik

2010-03-15


Author LoginPost Reply
Hi there,

Emmanuel and I had a discussion regarding a use case given in
http://opensource.atlassian.com/projects/hibernate/browse/HV-264

What if you have a list of strings and want to make sure that each string
is a valid email. Something like this (@(protected)
not helping here either):

@Email
List<String> emails ;


Initially I thought the problem could be quite easily solved by a custom
ConstraintValidator<Email, Iterable<String>>, but as it turns out there
are issues with generating the right property
path for invalid emails using the current ConstraintValidatorContext API.
Besides a custom ConstraintValidator would only be a specific solution for
a general problem. Hence, Emmanuel and I
discussed some solutions and summarized them on

http://opensource.atlassian.com/projects/hibernate/browse/BVAL-202 and
http://opensource.atlassian.com/projects/hibernate/browse/HV-296

It would be great to get some feedback.

--Hardy
_______________________________________________
hibernate-dev mailing list
hibernate-dev@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-dev
©2008 gg3721.com - Jax Systems, LLC, U.S.A.