Search in sources :

Example 6 with DictTypeVO

use of sqltoy.showcase.sagacity.vo.DictTypeVO in project sagacity-sqltoy by chenrenfei.

the class SqlToyCRUDServiceTest method testSaveOrUpdate.

@Test
public void testSaveOrUpdate() {
    DictTypeVO dictTypeVO = new DictTypeVO();
    dictTypeVO.setDictTypeCode("POST_TYPE");
    // 换一个主键值,则变为保存
    // dictTypeVO.setDictTypeCode("POST_TYPE");
    dictTypeVO.setDictTypeName("岗位类别1");
    dictTypeVO.setOperateDate(DateUtil.getNowTime());
    dictTypeVO.setOperator("admin");
    dictTypeVO.setDataType(0);
    dictTypeVO.setStatus("1");
    sqlToyCRUDService.saveOrUpdate(dictTypeVO, null);
}
Also used : DictTypeVO(sqltoy.showcase.sagacity.vo.DictTypeVO) Test(org.junit.Test)

Example 7 with DictTypeVO

use of sqltoy.showcase.sagacity.vo.DictTypeVO in project sagacity-sqltoy by chenrenfei.

the class SqlToyCRUDServiceTest method testSaveOrUpdateAll.

@Test
public void testSaveOrUpdateAll() {
    List entities = new ArrayList();
    DictTypeVO dictTypeVO = new DictTypeVO();
    dictTypeVO.setDictTypeCode("POST_TYPE");
    dictTypeVO.setDictTypeName("岗位类别更新");
    // dictTypeVO.setOperateDate(DateUtil.getNowTime());
    // dictTypeVO.setOperator("admin");
    dictTypeVO.setDataType(0);
    dictTypeVO.setStatus("1");
    entities.add(dictTypeVO);
    DictTypeVO dictTypeVO1 = new DictTypeVO();
    dictTypeVO1.setDictTypeCode("POST_TYPE2");
    dictTypeVO1.setDictTypeName("岗位类别2");
    // dictTypeVO1.setOperateDate(DateUtil.getNowTime());
    // dictTypeVO1.setOperator("admin");
    dictTypeVO1.setDataType(0);
    dictTypeVO1.setStatus("1");
    entities.add(dictTypeVO1);
    sqlToyCRUDService.saveOrUpdateAll(entities, null, new ReflectPropertyHandler() {

        @Override
        public void process() {
            this.setValue("status", "2");
        }
    });
}
Also used : DictTypeVO(sqltoy.showcase.sagacity.vo.DictTypeVO) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ReflectPropertyHandler(org.sagacity.sqltoy.callback.ReflectPropertyHandler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 DictTypeVO (sqltoy.showcase.sagacity.vo.DictTypeVO)7 ArrayList (java.util.ArrayList)3 List (java.util.List)3 ReflectPropertyHandler (org.sagacity.sqltoy.callback.ReflectPropertyHandler)1 DictDetailVO (sqltoy.showcase.sagacity.vo.DictDetailVO)1