知道为什么 hibernate 会抱怨类型转换吗?我已经将字符串作为字符串传递给函数。我正在使用带有命名参数的 @Query 语法。在查询中嵌入较低的函数可以吗?
源代码:
@Query("from UserEntity t where lower(t.email) = lower(:email)")
List<UserEntity> findByEmail(@Param("email") String email);
Run Code Online (Sandbox Code Playgroud)
错误:
Caused by: org.postgresql.util.PSQLException: ERROR: function lower(bytea) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 899
nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Run Code Online (Sandbox Code Playgroud)
相关链接:https : //docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.named-parameters