use of org.test.dao.TestDao in project Axe by DongyuCai.
the class DaoTest method testDynamicSql.
public static void testDynamicSql(String loginName, String mobile, String email) {
TestDao testDao = BeanHelper.getBean(TestDao.class);
List<Account> accountList = testDao.getAccountList(getSql(loginName, mobile, email));
System.out.println(accountList.size());
}
use of org.test.dao.TestDao in project Axe by DongyuCai.
the class DaoTest method testDynamicTable.
/**
* 测试动态表
*/
public static void testDynamicTable() {
TestDao testDao = BeanHelper.getBean(TestDao.class);
DnTable dnTable = new DnTable();
dnTable.setId(1l);
dnTable.setName("adf");
testDao.deleteEntity(dnTable);
}
use of org.test.dao.TestDao in project Axe by DongyuCai.
the class DaoTest method testDaoEntity.
public static void testDaoEntity() throws Exception {
TestDao testDao = BeanHelper.getBean(TestDao.class);
Export export = new Export();
export.setAccountId(1);
export.setCode("a");
export.setCreateTime(new Date());
export.setDownloadTimes(0);
export.setLastDownloadTime(null);
export.setName("xxx");
export.setProcess(100);
export.setStatus(1);
export.setStillWaitSec(100);
testDao.saveEntity(export);
export = testDao.getEntity(export);
System.out.println("getEntity:" + JsonUtil.toJson(export));
export.setCreateTime(new Date());
export = testDao.saveEntity(export);
System.out.println("saveEntity:" + export);
export.setName("新框架测试_SqlHelper");
int rows = testDao.updateEntity(export);
System.out.println("updateEntity:" + rows);
export = testDao.getEntity(export);
System.out.println("getEntity:" + JsonUtil.toJson(export));
rows = testDao.deleteEntity(export);
System.out.println("deleteEntity:" + rows);
rows = testDao.updateEntity(export);
System.out.println("updateEntity:" + rows);
export = testDao.insertEntity(export);
System.out.println("updateEntity:" + rows);
System.exit(0);
}
use of org.test.dao.TestDao in project Axe by DongyuCai.
the class DaoTest method testPrimarySql.
public static void testPrimarySql() {
TestDao testDao = BeanHelper.getBean(TestDao.class);
System.out.println(testDao.count());
}
use of org.test.dao.TestDao in project Axe by DongyuCai.
the class DaoTest method testDaoPaging.
public static void testDaoPaging() throws Exception {
TestDao testDao = BeanHelper.getBean(TestDao.class);
List<TestTable> all = testDao.getAll();
Page<TestTable> pageList = testDao.page();
for (TestTable e : all) {
System.out.print(e.getName() + "\t");
}
System.out.println();
System.out.println(pageList.getCount() + "\t" + pageList.getPages());
for (TestTable e : pageList.getRecords()) {
System.out.print(e.getName() + "\t");
}
System.out.println();
}