You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Raoua KHATERCHI (Jira)" <ji...@apache.org> on 2025/11/11 09:21:00 UTC

[jira] [Commented] (CXF-9174) Allow overriding buildPredicate in JPACriteriaQueryVisitor for custom predicates

    [ https://issues.apache.org/jira/browse/CXF-9174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18037383#comment-18037383 ] 

Raoua KHATERCHI commented on CXF-9174:
--------------------------------------

Hello,  
I would be happy to contribute a PR if we agree on the correct extension point (e.g., making buildPredicate or doBuildPredicate protected, or adding a hook method).
Could someone on the [~user_apache_jira] team confirm the preferred approach?

> Allow overriding buildPredicate in JPACriteriaQueryVisitor for custom predicates
> --------------------------------------------------------------------------------
>
>                 Key: CXF-9174
>                 URL: https://issues.apache.org/jira/browse/CXF-9174
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>         Environment: * Apache CXF 4.0.4
>  * {{cxf-rt-rs-extension-search}}
>  * Jakarta Persistence ({{{}jakarta.persistence{}}})
>            Reporter: Raoua KHATERCHI
>            Priority: Major
>             Fix For: 4.1.1
>
>
> I am using Apache CXF 4.0.4 with {{cxf-rt-rs-extension-search}} for building JPA Criteria queries via {{{}JPACriteriaQueryVisitor{}}}. Currently, the class {*}does not allow overriding or extending the {{buildPredicate}} logic{*}, because:
>  # The method {{buildPredicate(PrimitiveStatement ps)}} in {{AbstractJPATypedQueryVisitor}} is {*}private{*}, making it impossible to customize predicate generation.
>  # There is no protected or public extension point to apply custom transformations, such as accent-insensitive search, normalization of fields, or other domain-specific predicate logic.
> This limitation prevents extending CXF's FIQL/JPA Criteria integration for advanced use cases like accent-insensitive filtering in a way that works across Oracle and PostgreSQL.
> *Expected behavior:*
> Provide either:
>  * {{buildPredicate}} or similar method as *protected* in {{AbstractJPATypedQueryVisitor}} so it can be overridden, or
>  * A clear extension point in {{JPACriteriaQueryVisitor}} to allow customization of predicate generation without copying the entire class.
> This will allow developers to implement custom filtering logic (e.g., unaccented search, normalization) in a maintainable way without modifying CXF core classes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)