Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用postgres函数时出错;“较低”;在JPA命名查询中_Java_Postgresql_Hibernate_Spring Data Jpa - Fatal编程技术网

Java 使用postgres函数时出错;“较低”;在JPA命名查询中

Java 使用postgres函数时出错;“较低”;在JPA命名查询中,java,postgresql,hibernate,spring-data-jpa,Java,Postgresql,Hibernate,Spring Data Jpa,知道hibernate为什么抱怨打字吗?我已经将字符串传递给函数。我正在使用带有命名参数的@Query语法。在查询中嵌入较低的函数可以吗 源代码: @Query("from UserEntity t where lower(t.email) = lower(:email)") List<UserEntity> findByEmail(@Param("email") String email); 相关链接: 我终于明白发生了什么事。我得到这个错误是因为当我调用函数findByEmai

知道hibernate为什么抱怨打字吗?我已经将字符串传递给函数。我正在使用带有命名参数的@Query语法。在查询中嵌入较低的函数可以吗

源代码:

@Query("from UserEntity t where lower(t.email) = lower(:email)")
List<UserEntity> findByEmail(@Param("email") String email);
相关链接:
我终于明白发生了什么事。我得到这个错误是因为当我调用函数
findByEmail
时,在某些情况下,电子邮件是
null
,这导致发帖者抱怨。在调用此函数之前,我只需要检查
null
。感谢@akshar patel的帮助。

我终于明白发生了什么。我之所以会出现错误,是因为当我调用函数findByEmail时,在某些情况下,email为null,这导致了问题

您刚刚从@raym ag的应答中复制了第一部分。我们可以检查函数中的
null
值吗?我的意思是在函数中,而不是在调用之前。
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