So setzen Sie Abfrageparameter mit einzelnen Zitaten

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: So setzen Sie Abfrageparameter mit einzelnen Zitaten

by Anonymous » 21 Aug 2025, 07:15

Ich verwende eine Oracle -Datenbank. Ich muss eine Update -Abfrage über JPA -Repository ausführen. Dies ist die Abfrage, die ich ausführen habe. < /p>

@Transactional(propagation = Propagation.REQUIRES_NEW)
@Modifying
@Query(
value = "UPDATE transactionlog SET transactionstatus= :ps,startedat = CURRENT_TIMESTAMP, readytoprocessat= (CURRENT_TIMESTAMP+ interval ':to' second) WHERE logid IN (:li) ",
nativeQuery = true)
public Integer reserve(@Param("ps") short processingStatus, @Param("li") List logIdList, @Param("to") int timeOut);
< /code>

Aber diese Ausnahme < /p>

org.springframework.dao.InvalidDataAccessApiUsageException: Parameter with that name [to] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that name [to] did not exist
< /code>

Aber wenn ich diese Methode wie folgt ändere, funktioniert es gut. < /p>

@Transactional(propagation = Propagation.REQUIRES_NEW)
@Modifying
@Query(
value = "UPDATE transactionlog SET transactionstatus= :ps,startedat = CURRENT_TIMESTAMP, readytoprocessat= (CURRENT_TIMESTAMP+ interval '5' second) WHERE logid IN (:li) ",
nativeQuery = true)
public Integer reserve(@Param("ps") short processingStatus, @Param("li") List logIdList);
< /code>

Eine Idee? < /p>

Top