How it works · Persistence
Declare the business fields; the base class does the rest
An entity extends a Chenile base class and holds only business fields. Before every insert and update the base class fills in who changed it, when, for which tenant and whether it is test data, gives it an id, and guards it with a version column.
id
scenario
view
Step 1
Exchange
Payload
Audit by default
Created and modified times, the user and the tenant come from the request context in a JPA callback, so no service writes them and none forgets them.
Ids your way
String ids built from the request id, so a replayed request makes the same ids; numeric ids from a strategy bean you name; or ids the database assigns.
No lost updates
Every entity carries a version. Of two concurrent updates the first wins and the second fails, instead of silently overwriting it.