Investigate approach for a special group identifying contraints otherwise unassigned to a group.

Description

In https://hibernate.atlassian.net/browse/BVAL-638 I had a discussion with Gunnar Morling regarding a requirement to be able to specify a particular group when performing validation that selects contraints that are not explcitly assigned to a group.

This is to allow for relaxing constraints is specific circumstances while having default evaluation execute all constraints by default.

For example:

In the class

public interface Complete extends Default {};

@GroupSequence({Complete.class, A.class})
public class A {
@NotNull
public String a1;

@NotNull(groups={Complete.class})
public String a2;
}

public interface Complete extends Default {};
public interface Partial extends {};

@GroupSequence({Complete.class, A.class})
public class A {
@NotNull
public String a1;

@NotNull(groups={Complete.class})
public String a2;

@NotNull(groups={Complete.class})
@Null(groups={Partial.class}})
public String a3
}

validator.validate(instanceOfA, Partial.class, ALL_UNASSIGNED)

then the @Null constraint on a3 would be enforced but not otherwise. I think that would just work in the presence of an ALL_UNASSIGNED special validation group.

Environment

JDK 1.8.121

Assignee

Unassigned

Reporter

Tim Bartley

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Affects versions

Priority

Minor
Configure