Parameter 1 of function 'upper()' has type 'STRING', but argument is of type 'java.lang.String'

98 Views Asked by At

I'm using Springboot 3.x and Hibernate 6.4.4.Final and mysql.

I have some methods to create jpa like predicate.

    public static Predicate like(@NotNull CriteriaBuilder c, @NotNull Path<String> path, @NotNull String str) {
        return c.like(c.upper(path),
                "%" + str.toUpperCase().replace("/", "//").replace("_", "/_").replace("%", "/%") + "%", '/');
    }

    public static Predicate like(@NotNull CriteriaBuilder c, @NotNull Expression<String> expression, @NotNull String str) {
        return c.like(c.upper(expression),
                "%" + str.toUpperCase().replace("/", "//").replace("_", "/_").replace("%", "/%") + "%", '/');
    }

But I have this problem :

Parameter 1 of function 'upper()' has type 'STRING', but argument is of type 'java.lang.String'

I've tried to upgrade Hibernate to the last version. But it doesn't work

Thanks for your help.

0

There are 0 best solutions below