类 CRUDHelper
java.lang.Object
cool.scx.ext.crud.CRUDHelper
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidcheckFieldName(Class<?> modelClass, String fieldName) 检查 fieldName 是否合法static cool.scx.sql.order_by.OrderByTypecheckSortType(String fieldName, String strSortType) astatic voidcheckWhereBodyParametersSize(String fieldName, cool.scx.sql.where.WhereType whereType, Object value1, Object value2) 检查 whereBody 参数数量是否合法static cool.scx.sql.where.WhereTypecheckWhereType(String fieldName, String strWhereType) 检查 where 类型static Class<cool.scx.base.BaseModel>getBaseModelClassByName(String baseModelName) getClassByName.static cool.scx.base.BaseService<cool.scx.base.BaseModel>getBaseService(String modelName) 获取 servicestatic cool.scx.bo.QuerygetQuery(Class<? extends cool.scx.base.BaseModel> modelClass, Integer limit, Integer page, List<CRUDOrderByBody> orderByBodyList, List<CRUDWhereBody> whereBodyList) 获取 Querystatic cool.scx.base.BaseModelmapToBaseModel(Map<String, Object> entityMap, String baseModelName) 获取 baseModel
-
构造器详细资料
-
CRUDHelper
public CRUDHelper()
-
-
方法详细资料
-
getBaseService
获取 service- 参数:
modelName- model 名称- 返回:
- service
-
mapToBaseModel
public static cool.scx.base.BaseModel mapToBaseModel(Map<String, Object> entityMap, String baseModelName) 获取 baseModel- 参数:
entityMap- e- 返回:
- a
-
getBaseModelClassByName
public static Class<cool.scx.base.BaseModel> getBaseModelClassByName(String baseModelName) throws UnknownCRUDModelException getClassByName.
- 参数:
baseModelName- aStringobject.- 返回:
- a
Classobject. - 抛出:
UnknownCRUDModelException
-
getQuery
public static cool.scx.bo.Query getQuery(Class<? extends cool.scx.base.BaseModel> modelClass, Integer limit, Integer page, List<CRUDOrderByBody> orderByBodyList, List<CRUDWhereBody> whereBodyList) throws cool.scx.exception.impl.CustomHttpException 获取 Query- 参数:
limit- lpage- porderByBodyList- orwhereBodyList- wh- 返回:
- q
- 抛出:
cool.scx.exception.impl.CustomHttpException
-
checkFieldName
public static void checkFieldName(Class<?> modelClass, String fieldName) throws cool.scx.exception.impl.CustomHttpException 检查 fieldName 是否合法- 参数:
modelClass- mfieldName- f- 抛出:
cool.scx.exception.impl.CustomHttpException- c
-
checkWhereType
public static cool.scx.sql.where.WhereType checkWhereType(String fieldName, String strWhereType) throws cool.scx.exception.impl.CustomHttpException 检查 where 类型- 参数:
fieldName- fstrWhereType- s- 返回:
- s
- 抛出:
cool.scx.exception.impl.CustomHttpException- s
-
checkSortType
public static cool.scx.sql.order_by.OrderByType checkSortType(String fieldName, String strSortType) throws cool.scx.exception.impl.CustomHttpException a- 参数:
fieldName- astrSortType- a- 返回:
- a
- 抛出:
cool.scx.exception.impl.CustomHttpException- a
-
checkWhereBodyParametersSize
public static void checkWhereBodyParametersSize(String fieldName, cool.scx.sql.where.WhereType whereType, Object value1, Object value2) throws cool.scx.exception.impl.CustomHttpException 检查 whereBody 参数数量是否合法- 参数:
fieldName- fwhereType- wvalue1- vvalue2- v- 抛出:
cool.scx.exception.impl.CustomHttpException- v
-