Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HV-1487 If we are using a traverse all TraversableResolver, don't wrap
it into a caching one It avoids quite a lot of useless map lookups. Originally suggested by Chris Narburgh.
- Loading branch information
1 parent
fc454b6
commit 8b2f0d6
Showing
6 changed files
with
81 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...java/org/hibernate/validator/internal/engine/resolver/TraverseAllTraversableResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Hibernate Validator, declare and validate application constraints | ||
* | ||
* License: Apache License, Version 2.0 | ||
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>. | ||
*/ | ||
package org.hibernate.validator.internal.engine.resolver; | ||
|
||
import java.lang.annotation.ElementType; | ||
|
||
import javax.validation.Path; | ||
import javax.validation.Path.Node; | ||
import javax.validation.TraversableResolver; | ||
|
||
|
||
/** | ||
* {@link TraversableResolver} considering that all properties are reachable and cascadable. | ||
* <p> | ||
* This is the default behavior if JPA is not detected in the classpath. | ||
* | ||
* @author Guillaume Smet | ||
*/ | ||
public class TraverseAllTraversableResolver implements TraversableResolver { | ||
|
||
TraverseAllTraversableResolver() { | ||
} | ||
|
||
@Override | ||
public boolean isReachable(Object traversableObject, Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, | ||
ElementType elementType) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isCascadable(Object traversableObject, Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, | ||
ElementType elementType) { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters