Let me try to be a bit more clear.
Consider this entity:
@Entity
public class Employee
{
private String _name;
// ...
@Size(min = 1, max = 50)
public String getName()
{
return _name;
}
// ...
}
If some client of mine asked me to change the name of the employees to accept 70
characters because 50 is not enough anymore I have to change my application for all
clients. But if the bean validation specification allowed me to configure the constraints
dinamically I could do this configuration on a cliente basis. All I had to do was to
change the database structure for the specific column, register this fact in some table of
mine and in the application startup my application would check for changes and configure
the corresponding bean constraint. With static constraints (as it is today) we don't
have this flexibility.
Marcos
----------------------------
From: emmanuel(a)hibernate.org
Date: Mon, 24 Feb 2014 19:00:35 +0100
Subject: Re: [bv-dev] Configure validation constraints at runtime
To: beanvalidation-dev(a)lists.jboss.org; marcos_antonio_ps(a)hotmail.com
Hi
We don't have a defined roadmap for the future of Bean Validation. But that would be a
nice addition in my opinion.
What's your use case for it?
Emmanuel