Search in sources :

Example 1 with TestTable

use of org.test.bean.TestTable in project Axe by DongyuCai.

the class DaoTest method testInsert.

public static void testInsert() throws Exception {
    TestTable test = new TestTable();
    test.setId(3);
    test.setName("test3");
    test = DataBaseHelper.insertOnDuplicateKeyEntity(test);
    System.out.println(JsonUtil.toJson(test));
    /*Export export = new Export();
		export.setName("abc");
		TestDao testDao = BeanHelper.getBean(TestDao.class);
		export = testDao.saveEntity(export);
		System.out.println(export.getId());*/
    System.exit(0);
}
Also used : TestTable(org.test.bean.TestTable)

Example 2 with TestTable

use of org.test.bean.TestTable 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)

Example 3 with TestTable

use of org.test.bean.TestTable in project Axe by DongyuCai.

the class TestController method getOne.

//==================== postman success ================//
@Request(value = "/getOne/{id}", method = RequestMethod.GET)
public Data getOne(@RequestParam("id") Long id, Param param) {
    //    	Data data = analysisParam(param);
    if (id == null) {
        throw new RestException(RestException.SC_BAD_REQUEST, "id不正确");
    }
    TestTable one = testService.get(id);
    Data data = new Data(one);
    return data;
}
Also used : RestException(org.axe.exception.RestException) Data(org.axe.bean.mvc.Data) TestTable(org.test.bean.TestTable) HttpServletRequest(javax.servlet.http.HttpServletRequest) Request(org.axe.annotation.mvc.Request)

Aggregations

TestTable (org.test.bean.TestTable)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Request (org.axe.annotation.mvc.Request)1 Data (org.axe.bean.mvc.Data)1 RestException (org.axe.exception.RestException)1 TestDao (org.test.dao.TestDao)1