babyfish-ct / jimmer

A revolutionary ORM framework for both java and kotlin.
Apache License 2.0
877 stars 88 forks source link

[Feature Request] Add Upsert Support for Entities with Only ID and No Key Definitions #652

Closed ArgonarioD closed 2 months ago

ArgonarioD commented 2 months ago

In some scenarios, developers need to design entity models with no keys that have actual business meaning. In such cases, when executing the save command, if the id of this type of entity aggregate root object is unloaded, it should behave as an insert; if it is loaded, it should behave as an update.

Since version 0.8.160, Jimmer no longer supports the upsert function for such entity models. This issue DOES NOT aim to disrupt the behavior consistency between the aggregate root object and the associated objects during save. Instead, it seeks to restore this feature in some other form.

It would be cool if Jimmer could cover more reasonable scenarios.

babyfish-ct commented 2 months ago

Try 0.8.166, SaveMode.NON_IDEMPOTENT_UPSERT