I see more and more projects start using code generators for their entities. Here are some libraries which generate java code: # [Immutables|https://immutables.github.io/] # [AutoValue|https://github.com/google/auto/blob/master/value/userguide/index.md] # [FreeBuilder|http://freebuilder.inferred.org/]
They all seem to adopt direct name accessors instead of getters (from Java Beans): h3. Example {code:java} public interface Entity { @NotBlank String name(); // instead of getName();
@Min(16) int age(); // instead of getAge(); } {code}
It seem seems that hibernate validator still requires POJOs to follow java bean convention. Having standard {{getName() / getAge()}} works just fine.
Is it currently possible to plug custom method name resolution with Validator ? |
|