We're updating the issue view to help you get more done. 

Simplify GroupSequence for ordered checking

Description

The JSR 303 is becoming defacto solution at enterprise level projects however I think that it has a significant useless part. The current implementation states group sequence must be utilized to ordered validation. In order to use group sequence, one has to define interfaces for each order sequence such this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 public class AccountBean { @CheapValidation(groups=Name1.class) @ExpensiveValidation(groups=Name2.class) @VeryExpensiveValidation(groups=Name3.class) String name; @CheapValidation(groups=Surname1.class) @ExpensiveValidation(groups=Surname2.class) @VeryExpensiveValidation(groups=Surname3.class) String surname; public interface Name1 {} public interface Name2 {} public interface Name3 {} @GroupSequence({Name1.class, Name2.class, Name3.class}) public interface Name {} public interface Surname1 {} public interface Surname2 {} public interface Surname3 {} @GroupSequence({Surname1.class, Surname2.class, Surname3.class}) public interface Surname {} }

Look the code how it is ugly and useless. What I am offering is a simplified version of ordering such this:

1 2 3 4 5 6 7 8 9 10 11 12 public class AccountBean { @CheapValidation(order=0,groups=Name1.class) @ExpensiveValidation(order=1,groups=Name2.class) @VeryExpensiveValidation(order=2,groups=Name3.class) String name; @CheapValidation(order=0,groups=Surname1.class) @ExpensiveValidation(order=1,groups=Surname2.class) @VeryExpensiveValidation(order=2,groups=Surname3.class) String surname; }

Almost all enterprise projects needs such kind of things. For example lets say that you want to validate email field by NotEmpty and UniqueAtDatabase. Why should we show two error messages in this case? Shortly, to increase usability and adaptability please solve this issue.

PS: This issue is cross posted here and forums.

https://forum.hibernate.org/viewtopic.php?f=26&t=1007328

Environment

None

Status

Assignee

Unassigned

Reporter

Cemo Koc

Labels

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

Affects versions

1.0 final

Priority

Major