9. Update语句
- Java
- Kotlin
BookTable table = BookTable.$;
int affectedRowCount = sqlClient
.createUpdate(table)
.set(table.price(), table.price().plus(BigDecimal.ONE))
.where(table.name().eq("GraphQL in Action"))
.execute();
val affectedRowCount = sqlClient
.createUpdate(Book::class) {
set(table.price, table.price + BigDecimal.ONE)
where(table.name eq "GraphQL in Action")
}
.execute()