枚举类 SaveMode
- 所有已实现的接口:
Serializable,Comparable<SaveMode>,Constable
Notes, this only affect root objects, not associated objects
To control associated objects, please view AssociatedSaveMode
- 另请参阅:
-
枚举常量详细资料
-
UPSERT
Insert or update the aggregate-root object(s).- If it's possible to use low-level database upsert capabilities, the corresponding SQL will be generated.
- Otherwise, Jimmer will first execute a select
statement and decide whether the subsequent operation
should be an insert or update based on the query results.
In this case, the
purposefield of the corresponding SQL statement in the SQL log will provide the query reason. Users can refer toQueryReasonto understand what happened, in an effort to optimize to the former situation.
-
INSERT_ONLY
-
UPDATE_ONLY
-
NON_IDEMPOTENT_UPSERT
This mode is basically the same asUPSERT, but it handles wild objects differently.A wild object is an object with neither
IdnorKey. The difference between this mode and theUPSERTmode is as follows:UPSERT: Considers wild objects illegal, throwsSaveException.NeitherIdNorKeyNON_IDEMPOTENT_UPSERT: Ignores the risk of breaking idempotency and unconditionally inserts wild objects.
This mode is actually similar to the `
saveOrUpdate` in other frameworks, so most developers are very familiar with it. However, Jimmer does not recommend this mode because it is really not a good idea.
-
-
方法详细资料
-
values
返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同- 返回:
- 包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
-
valueOf
返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类没有带有指定名称的常量NullPointerException- 如果参数为空值
-