public static class IOrmPersistent.DefaultImpls
ORM之持久化,主要是负责数据库的增删改查
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
afterCreate(IOrmPersistent $this)
处理create后置事件
|
static void |
afterDelete(IOrmPersistent $this)
处理delete后置事件
|
static void |
afterSave(IOrmPersistent $this)
处理save后置事件
|
static void |
afterUpdate(IOrmPersistent $this)
处理update后置事件
|
static void |
beforeCreate(IOrmPersistent $this)
处理create前置事件
|
static void |
beforeDelete(IOrmPersistent $this)
处理delete前置事件
|
static void |
beforeSave(IOrmPersistent $this)
处理save前置事件
|
static void |
beforeUpdate(IOrmPersistent $this)
处理update前置事件
|
static void |
beforeValidate(IOrmPersistent $this)
处理validate前置事件
orm 的 validate() 可能直接调用, 而不一定通过 create()/update() 等间接调用
|
static java.lang.Object |
getOrPut(IOrmPersistent $this,
java.lang.String key,
kotlin.jvm.functions.Function0<? extends java.lang.Object> defaultValue) |
static boolean |
isDirty(IOrmPersistent $this,
NonExistentClass key) |
static boolean |
isPkEmpty(IOrmPersistent $this,
java.lang.Object pk)
检查主键值是否为空
|
static void |
loadByPk(IOrmPersistent $this,
java.lang.Object pks)
根据主键值来加载数据
如果是复合主键, 则参数按 ormMeta.primaryKey 中定义的字段的属性来传值
|
static boolean |
save(IOrmPersistent $this,
boolean withHasRelations)
保存数据
|
static java.util.Map<java.lang.String,java.lang.Object> |
toMap(IOrmPersistent $this,
java.util.List<java.lang.String> include,
java.util.List<java.lang.String> exclude) |
static void |
validateOrThrow(IOrmPersistent $this) |
public static boolean isPkEmpty(IOrmPersistent $this, java.lang.Object pk)
检查主键值是否为空
public static void loadByPk(IOrmPersistent $this, java.lang.Object pks)
根据主键值来加载数据 如果是复合主键, 则参数按 ormMeta.primaryKey 中定义的字段的属性来传值
public static boolean save(IOrmPersistent $this, boolean withHasRelations)
保存数据
public static void beforeValidate(IOrmPersistent $this)
处理validate前置事件 orm 的 validate() 可能直接调用, 而不一定通过 create()/update() 等间接调用
public static void beforeCreate(IOrmPersistent $this)
处理create前置事件
public static void afterCreate(IOrmPersistent $this)
处理create后置事件
public static void beforeUpdate(IOrmPersistent $this)
处理update前置事件
public static void afterUpdate(IOrmPersistent $this)
处理update后置事件
public static void beforeSave(IOrmPersistent $this)
处理save前置事件
public static void afterSave(IOrmPersistent $this)
处理save后置事件
public static void beforeDelete(IOrmPersistent $this)
处理delete前置事件
public static void afterDelete(IOrmPersistent $this)
处理delete后置事件
public static void validateOrThrow(IOrmPersistent $this)
public static boolean isDirty(IOrmPersistent $this, NonExistentClass key)
public static java.lang.Object getOrPut(IOrmPersistent $this, java.lang.String key, kotlin.jvm.functions.Function0<? extends java.lang.Object> defaultValue)
public static java.util.Map<java.lang.String,java.lang.Object> toMap(IOrmPersistent $this, java.util.List<java.lang.String> include, java.util.List<java.lang.String> exclude)