Marko Bekhta (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HV-1949 (
https://hibernate.atlassian.net/browse/HV-1949?atlOrigin=eyJpIjoiZTQ3NGMw...
)
Re: Nondeterministic behavior of HibernateValidator (in springboot?) when both annotation
and xml-based definition are used (
https://hibernate.atlassian.net/browse/HV-1949?atlOrigin=eyJpIjoiZTQ3NGMw...
)
Hey Martin, thanks for getting back with your experiments. I’ve looked at your various fix
branches –
https://github.com/alfonz19/validator-fail-mwe/compare/fixC#diff-4703104a...
this one is good you only need to remove the XML files to make it work. You have correctly
added a mapping here:
ConstraintMapping constraintMapping = hvc.createConstraintMapping();
constraintMapping.type( mwe.validatorfail.dto.SampleDTO.class ) //
instead of an XML
.getter( "uuid" )
.constraint( new
GenericConstraintDef<>(AnyUuid.class) )
.constraint( new NotNullDef() );
hvc.addMapping(constraintMapping);
But since the XML files are still present – the constraints for
mwe.validatorfail.dto.SampleDTO are coming from multiple places (including XML) and that
leads to problems. So give this fixC a try and remove the validation.xml ,
validation-constraints.xml files.
as for (3) yeah … I’ve been thinking about this one. If a constraint validator is loaded
via service loader, then trying to do something about it with programmatic mappings
doesn’t work since HV considers both explicit programmatic mappings and service-loaded
validators as the “same programmatic definitions”. What bugs me here is that if that's
so – there’s no way to override whatever comes from service loader… I’ll think about it of
maybe we should change that.
(
https://hibernate.atlassian.net/browse/HV-1949#add-comment?atlOrigin=eyJp...
) Add Comment (
https://hibernate.atlassian.net/browse/HV-1949#add-comment?atlOrigin=eyJp...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:2b972a1 )