接口 CRUDHandler

所有已知实现类:
CRUDHandlerImpl

public interface CRUDHandler
crud 各个逻辑的 handler
  • 方法详细资料

    • checkUnique

      default boolean checkUnique(String modelName, String fieldName, Object value, Long id)
      检查字段值唯一性
      参数:
      modelName - model 名称
      fieldName - 列名称
      value - 列值
      id - id (不为空时会排除此 id 进行唯一性检查)
      返回:
      是否唯一
    • revokeDelete

      default boolean revokeDelete(String modelName, Long id)
      参数:
      modelName - model 名称
      id - model 的 id
      返回:
      r
    • batchDelete

      default long batchDelete(String modelName, long[] deleteIDs)
      批量删除
      参数:
      modelName - model 名称
      deleteIDs - 批量删除的 id
      返回:
      r
    • delete

      default boolean delete(String modelName, Long id)
      删除
      参数:
      modelName - model 名称
      id - model 类的 id
      返回:
      r
    • update

      default cool.scx.base.BaseModel update(String modelName, Map<String,Object> entityMap)
      更新数据
      参数:
      modelName - model 名称
      entityMap - 可以转换为 model类的 map (其中需要存在 id)
      返回:
      c
    • save

      default cool.scx.base.BaseModel save(String modelName, Map<String,Object> entityMap)
      参数:
      modelName - model 名称
      entityMap - 可以转换为 model类的 map
      返回:
      c
    • info

      default cool.scx.base.BaseModel info(String modelName, Long id)
      获取单条数据信息
      参数:
      modelName - model 名称
      id - 查询的 id
      返回:
      单条数据信息
    • list

      default CRUDListResult list(String modelName, Integer limit, Integer page, List<CRUDOrderByBody> orderByBodyList, List<CRUDWhereBody> whereBodyList)
      获取列表数据
      参数:
      modelName - model 名称
      limit - 分页:每页数据
      page - 分页:页码
      orderByBodyList - 排序参数 (字段,类型)
      whereBodyList - 查询参数
      返回:
      列表数据