Function Contributor doesn't work on Hibernate 6.5

After I upgrade hibernate orm from 6.4 to 6.5.

Function Contributor doesn’t work. I used function contributor with QueryDSL like below.

            "function('matches_against', {0}, {1}, {2})", target_path1, target_path2, keyword

Before I upgraded, the statement had been converted to “MATCH (?1, ?2) AGAINST (?3 IN NATURAL LANGUAGE MODE)”. But after I upgraded, the statement wasn’t converted and invoked exception

org.hibernate.query.SemanticException: Non-boolean expression used in predicate context:

After I’m digging, I found that function contributor worked with the statement like this

            "matches_against({0}, {1}, {2})", target1, target2, keyword

I guess there is an issue on converting logic, "function(‘xxx’, …)’ to ‘xxx(…)’.

Does anyone experience this issue?


I’d be glad to help you with the Hibernate ORM Function Contributor issue you’re encountering after upgrading from version 6.4 to 6.5.

Understanding the Problem:

Based on the information you provided, it seems that the upgrade to Hibernate ORM 6.5 has affected the way functionContributor works with QueryDSL. Previously, it would convert function(‘matches_against’, …) to the appropriate SQL expression (MATCH (…) AGAINST (…)). However, after the upgrade, this conversion is no longer happening, leading to a SemanticException.

Potential Solutions:

Check Hibernate Release Notes:

Carefully review the release notes for Hibernate ORM 6.5 (especially any sections related to QueryDSL or function contributors). This might provide mary kay in touch insights into known issues or breaking changes that could be causing the problem.
Verify Configuration:

Ensure that your Hibernate configuration hasn’t inadvertently changed during the upgrade process. Double-check any settings related to QueryDSL, function contributors, or dialect mappings.
Consider Alternative Syntax:

As a workaround, you might be able to achieve the desired functionality by using the alternative syntax you discovered:

    "matches_against({0}, {1}, {2})", target1, target2, keyword

Provide more context if you seek further assistance:

Specific versions of Hibernate ORM, QueryDSL, and any relevant libraries.
Full error stack trace for the SemanticException.

Stay updated with Hibernate documentation and release notes to learn about potential changes and best practices.

By following these steps, you should be able to resolve the Function Contributor issue and restore the expected behavior in your upgraded Hibernate ORM environment.

I hope the information may help you.