我正在使用Hibernate / JPA执行本机PostGIS查询。这些查询的问题在于它们需要的参数并不是经典的 X = 'value' 形式。
我的查询是:
@Modifying
@Query(value="UPDATE memo SET readMemo = true and updatedBy_id = ?1 and updatedBy = ?1 and updatedOn = ?2 where assignToUser_id = 1? and readMemo = false and deleted = false ",nativeQuery = true)
void readAllMenoByCurrentUser(Long id, Date updateTime);
错误:-
org.springframework.dao.InvalidDataAccessApiUsageException: Cannot mix JPA positional parameters and native Hibernate positional/ordinal parameters; nested exception is java.lang.IllegalArgumentException: Cannot mix JPA positional parameters and native Hibernate positional/ordinal parameters
有人知道如何解决这个问题吗?