我在 SpringBoot 中使用 JPARepository 并使用@Query
注释,但出现错误
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
当使用nativeQuery=true
这是我的功能:
@Query(value = "select * from table1 where status = ?1 and time <= ?2 LIMIT 2", nativeQuery = true) List<MyModel> findScheduledSmsMessages(Status status, LocalDateTime time);
潇湘沐
相关分类