Search in sources :

Example 1 with TestDao

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());
}
Also used : Account(org.test.bean.Account) TestDao(org.test.dao.TestDao)

Example 2 with TestDao

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);
}
Also used : DnTable(org.test.bean.DnTable) TestDao(org.test.dao.TestDao)

Example 3 with TestDao

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);
}
Also used : Export(org.test.bean.Export) Date(java.util.Date) TestDao(org.test.dao.TestDao)

Example 4 with TestDao

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());
}
Also used : TestDao(org.test.dao.TestDao)

Example 5 with TestDao

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();
}
Also used : TestTable(org.test.bean.TestTable) TestDao(org.test.dao.TestDao)

Aggregations

TestDao (org.test.dao.TestDao)5 Date (java.util.Date)1 Account (org.test.bean.Account)1 DnTable (org.test.bean.DnTable)1 Export (org.test.bean.Export)1 TestTable (org.test.bean.TestTable)1