public class DalAssert extends Object
| 构造器和说明 |
|---|
DalAssert() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
assertClassTypeNotNull(Class cls)
用于确定决定策略的Class 对象是否为空
|
static void |
assertDaoMapException(MapItem mapItem)
用于确定dao.xml中配置的map元素是否出现异常
|
static void |
assertListIllegal(Object userId,
List list) |
static void |
assertObjectIllegal(Object userId,
Object obj)
用于判断数据的合法性 ,主要用于检查对象的策略id.
|
static void |
assertObjectNotNull(List obs) |
static void |
assertObjectNotNull(Object obj)
用于确定对象是否为NULL
|
static void |
assertObjectNotNull(Object obj,
String description) |
static void |
assertSessionFactoryNotNull(org.hibernate.SessionFactory sessionFactory)
用于确定SessionFactory是否为NULL
|
static void |
assertTwoListEquals(List list1,
List list2)
用于检查,类似getMapList 这样的需求中,传入参数的有效性
|
public static void assertObjectIllegal(Object userId, Object obj) throws DaoException
userId - :
策略idobj - :
检查的对象DaoExceptionpublic static void assertListIllegal(Object userId, List list) throws DaoException
DaoExceptionpublic static void assertClassTypeNotNull(Class cls) throws DaoException
cls - :用于决定策略的Class类型DaoExceptionpublic static void assertObjectNotNull(Object obj) throws DaoException
DaoExceptionpublic static void assertObjectNotNull(List obs) throws DaoException
DaoExceptionpublic static void assertObjectNotNull(Object obj, String description) throws DaoException
DaoExceptionpublic static void assertSessionFactoryNotNull(org.hibernate.SessionFactory sessionFactory)
throws DaoException
DaoExceptionpublic static void assertDaoMapException(MapItem mapItem) throws DaoException
DaoExceptionpublic static void assertTwoListEquals(List list1, List list2) throws DaoException
DaoExceptionCopyright © 2022. All rights reserved.