> For the complete documentation index, see [llms.txt](https://query.docs.doyto.win/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://query.docs.doyto.win/object-concepts/patch-object.md).

# Patch Object

DoytoQuery supports **incremental updates** on numeric fields using special suffixes in the patch object.;

## Suffix Mapping

For example, to increase a user's score by a certain amount without first reading the original value, you can use a field like `scoreAe` (short for *Add/Extend*).

```java
public class UserPatch extends UserEntity {
    private Integer scoreAe;
}
```

```java
UserEntity userPatch = UserPatch.builder().id(1).valid(true).scoreAe(20).build();
userDataAccess.patch(userPatch);
// SQL: UPDATE t_user SET valid = ?, score = score + ? WHERE id = ?
```

## Annotation Mapping

Use `@Clause` to define a custom condition:

```java
public class UserPatch extends UserEntity {
    @Clause("score = score + ?")
    private Integer scoreAe;
}
```
