1
我有以下的JPA實體錯誤軟刪除
@SQLDelete(sql="UPDATE service SET date_deletion = CURRENT_DATE() WHERE id = ?")
@Where(clause="date_deletion IS NULL ")
public class Service {
...
}
選擇工作確定所有與date_deletion告知沒有示明,但元素,當我嘗試刪除....
16:38:26,836 DEBUG SQL:111 - UPDATE service SET date_deletion = CURRENT_DATE() WHERE id = ?
16:38:26,836 DEBUG AbstractBatcher:418 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
16:38:26,836 DEBUG JDBCExceptionReporter:225 - could not delete: [com.foo.domain.Service#1] [UPDATE service SET date_deletion = CURRENT_DATE() WHERE id = ?]
java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
SQL中有什麼問題?看起來像嘗試處理CURRENT_DATE()作爲參數,並期望2參數,而不是1 ...