If this is just a validation issue, consider using your own implementation of TraversableResolver instead of JPATraversableResolver or DefaultTraversableResolver. Here's how to do it .
JPATraversableResolver may cause unwanted JPA dependency. Here is a guy with a similar problem.
Of course, if you expect your application to be compatible with JPA2, this is not a solution.
public class MyTraversableResolver implements TraversableResolver { public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class rootBeanType, Path pathToTraversableObject, ElementType elementType) { return true; } public boolean isCascadable(Object traversableObject, Path.Node traversableProperty, Class rootBeanType, Path pathToTraversableObject, ElementType elementType) { return true; } }
source share