没有时区的时间戳> = bytea

时间:2018-04-27 13:56:37

标签: postgresql spring-data-jpa

我想在Jpa Repository中的原生查询中传递日期。我尝试了很多东西,如传递日期,字符串,但无法进行查询工作。我是Jpa Repository的新手。 我试过这个链接: https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#_native_queries

但在那里,他们没有给出约会的例子。我正在为我需要的代码提供以下代码:

@Query(value ="select * from \"order\" ord where ord.agent_id = :agentId and ord.order_date >= :startDate order by ?#{#pageable}", nativeQuery = true)
Page findByAgentId(@Param("agentId") Long agentId, @Param("startDate") String startDate, Pageable pageable);

错误是:


org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp without time zone >= bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

并且,我使用postgres作为DB。

0 个答案:

没有答案