CXF-9174: Allow customization of JPA FIQL predicate building#2798
CXF-9174: Allow customization of JPA FIQL predicate building#2798raoua-eng wants to merge 5 commits intoapache:mainfrom
Conversation
protected for extensibility
|
Hi @reta, Let me know if you'd like any adjustments. |
|
@reta |
Yeah, something is unstable, I will rerun checks shortly |
|
@raoua-eng could you please fix checkstyle violations: |
|
Fixed whitespace and tab character issues. |
...sions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/CustomJPACriteriaVisitor.java
Show resolved
Hide resolved
.../src/test/java/org/apache/cxf/jaxrs/ext/search/jpa/JPACriteriaQueryVisitorExtensionTest.java
Show resolved
Hide resolved
AbstractJPATypedQueryVisitor.java
@raoua-eng could you please run |
|
@reta I ran mvn |
Thanks @raoua-eng , well, we cannot merge unless checks pass. If you are up to it, would be great to fix those, thank you |
Make doBuildPredicate and doBuildCollectionPredicate methods protected in AbstractJPATypedQueryVisitor to allow subclasses to customize predicate construction for specific properties or collection checks. Add getEntityManager() accessor to AbstractJPATypedQueryVisitorTest and new test classes demonstrating the extension capability. Based on PR apache#2798 by mkarg, with fixes for checkstyle compliance (tabs to spaces, import ordering) and corrected test assertions.
- Convert tabs to spaces in new test files - Fix import ordering (static imports at bottom per CXF convention) - Use path.getModel() instead of path.getAlias() for attribute identification (getAlias() returns null for JPA paths) - Use case-insensitive LIKE in custom visitor test - Fix collection predicate test to use count() syntax that actually triggers the collection check path
This PR addresses CXF-9174.
It makes doBuildPredicate(...) and doBuildCollectionPredicate(...) protected to allow customization of predicate construction in JPACriteriaQueryVisitor.
A new test demonstrates how a custom visitor can override predicate behavior without duplicating the entire visitor implementation.
This enables use cases such as database-specific functions (e.g. accent-insensitive comparisons).