Thank you for your replies. We managed to get it working by creating our own version of the BeanValidationListener. We found that the exception was thrown at the following code:
Code:
/**
* @return true if given path corresponds to Root Object else false.
*/
private boolean isRootObjectPath(Path pathToTraversableObject) {
// From Bean Validation spec section 3.5.2
// <quote>
// pathToTraversableObject is the Path from the rootBeanType down to the traversableObject (it is composed of
// a single Node whose name is null if the root object is traversableObject). The path is described following the
// conventions described in Section 4.2 (getPropertyPath).
// </quote>
return pathToTraversableObject.iterator().next().getName() == null;
}
By simply returning 'true' when the object is not iterable it works like a treat.
An easy way to test it is by simply using your example of @ScriptAssert where the end date has to be before the start date. Once you try to persist the entity, you will get the error.