So setzen Sie Abfrageparameter mit einzelnen ZitatenJava

Java-Forum
Anonymous
 So setzen Sie Abfrageparameter mit einzelnen Zitaten

Post by Anonymous »

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>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post