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 ...