org.test4j.module.database.dbop
接口 ITableOp


public interface ITableOp


方法摘要
 ITableOp clean()
          清空数据表
 void commit()
          提交数据
 INumberAssert count()
          查询表count(*)的值,并且返回断言器
 ITableOp insert(DataSet dataset)
          插入数据集
 ITableOp insert(ICore.DataMap data, ICore.DataMap... datas)
          根据Map的key(表字段)插入数据
 ITableOp insert(int count, ICore.DataMap data)
          批量插入count条数据
 ITableOp insert(String json, String... more)
          根据json插入数据
 ICollectionAssert query()
          查询表数据,做数据断言
 IObjectAssert queryAs(Class pojo)
          查询单条数据,转换为PoJo对象。
 ICollectionAssert queryList(Class pojo)
          查询表中所有的数据,并且每条数据填充到PoJo中
返回 List 的断言器
 ICollectionAssert queryWhere(ICore.DataMap where)
          根据条件查询数据,并返回数据断言器
 ICollectionAssert queryWhere(String where)
          根据条件查询数据,并返回数据断言器
 void rollback()
          回滚数据
 

方法详细信息

clean

ITableOp clean()
清空数据表

返回:

insert

ITableOp insert(String json,
                String... more)
根据json插入数据

参数:
json -
more -
返回:

insert

ITableOp insert(int count,
                ICore.DataMap data)
批量插入count条数据

参数:
count - 需要插入的数据的数量
data - 需要插入的数据 Map,key:字段,value:n条数据的数组集合和策略
返回:

insert

ITableOp insert(ICore.DataMap data,
                ICore.DataMap... datas)
根据Map的key(表字段)插入数据

参数:
data -
datas -
返回:

insert

ITableOp insert(DataSet dataset)
插入数据集

参数:
dataset -
返回:

commit

void commit()
提交数据


rollback

void rollback()
回滚数据


query

ICollectionAssert query()
查询表数据,做数据断言

返回:

queryWhere

ICollectionAssert queryWhere(String where)
根据条件查询数据,并返回数据断言器

参数:
where -
返回:

queryWhere

ICollectionAssert queryWhere(ICore.DataMap where)
根据条件查询数据,并返回数据断言器

参数:
where -
返回:

queryList

ICollectionAssert queryList(Class pojo)
查询表中所有的数据,并且每条数据填充到PoJo中
返回 List 的断言器

参数:
table -
pojo -
返回:

queryAs

IObjectAssert queryAs(Class pojo)
查询单条数据,转换为PoJo对象。并且返回对象断言器

参数:
pojo -
返回:

count

INumberAssert count()
查询表count(*)的值,并且返回断言器

返回:


Copyright © 2013. All rights reserved.