Add the possibility to configure constraint definition dynamically

Description

It would be very helpful if the BV specification allowed us to configure constraints dynamically.

Consider this simple use case:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 @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 dynamically I could do this configuration on a client 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.

This is just one use case, but I'm sure that there are other situations where this feature is needed as well.

Environment

None

Status

Assignee

Unassigned

Reporter

Marcos

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major