Class BaseDaoMetaObjectHandler
java.lang.Object
com.codeupsoft.base.dao.handler.BaseDaoMetaObjectHandler
- All Implemented Interfaces:
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
public class BaseDaoMetaObjectHandler
extends Object
implements com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
DAO层元对象处理器,用于自动填充创建时间和更新时间等字段.
该类实现了MyBatis-Plus的MetaObjectHandler接口, 在执行insert和update操作时自动填充实体类中的通用字段.
支持自动填充的字段包括:
- 创建时间相关字段:createTime, createdTime, createDate, createdDate
- 更新时间相关字段:updateTime, updatedTime, updateDate, updatedDate
- 其他通用字段:version, dataVersion, enabled, isEnabled, deleted, isDeleted
- Author:
- Liu,Dongdong
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidautoFill(org.apache.ibatis.reflection.MetaObject metaObject, Map<String, MetaValueFillFunction> map, boolean notNullOverride) 自动填充字段值.voidinsertFill(org.apache.ibatis.reflection.MetaObject metaObject) 插入时自动填充字段值.protected Map<String, MetaValueFillFunction> 获取插入操作需要填充的字段映射.voidupdateFill(org.apache.ibatis.reflection.MetaObject metaObject) 更新时自动填充字段值.protected Map<String, MetaValueFillFunction> 获取更新操作需要填充的字段映射.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
fillStrategy, findTableInfo, getFieldValByName, openInsertFill, openInsertFill, openUpdateFill, openUpdateFill, setFieldValByName, strictFill, strictFillStrategy, strictInsertFill, strictInsertFill, strictInsertFill, strictUpdateFill, strictUpdateFill, strictUpdateFill
-
Constructor Details
-
BaseDaoMetaObjectHandler
public BaseDaoMetaObjectHandler()
-
-
Method Details
-
insertFill
public void insertFill(org.apache.ibatis.reflection.MetaObject metaObject) 插入时自动填充字段值.- Specified by:
insertFillin interfacecom.baomidou.mybatisplus.core.handlers.MetaObjectHandler- Parameters:
metaObject- 元对象
-
updateFill
public void updateFill(org.apache.ibatis.reflection.MetaObject metaObject) 更新时自动填充字段值.- Specified by:
updateFillin interfacecom.baomidou.mybatisplus.core.handlers.MetaObjectHandler- Parameters:
metaObject- 元对象
-
autoFill
protected void autoFill(org.apache.ibatis.reflection.MetaObject metaObject, Map<String, MetaValueFillFunction> map, boolean notNullOverride) 自动填充字段值.- Parameters:
metaObject- 元对象map- 字段名与填充值函数的映射关系notNullOverride- 是否覆盖非空字段
-
insertMap
-
updateMap
-