예제 #1
0
 @Transactional(readOnly = false)
 public void save(TestDataMain testDataMain) {
   super.save(testDataMain);
   for (TestDataChild testDataChild : testDataMain.getTestDataChildList()) {
     if (testDataChild.getId() == null) {
       continue;
     }
     if (TestDataChild.DEL_FLAG_NORMAL.equals(testDataChild.getDelFlag())) {
       if (StringUtils.isBlank(testDataChild.getId())) {
         testDataChild.setTestDataMain(testDataMain);
         testDataChild.preInsert();
         testDataChildDao.insert(testDataChild);
       } else {
         testDataChild.preUpdate();
         testDataChildDao.update(testDataChild);
       }
     } else {
       testDataChildDao.delete(testDataChild);
     }
   }
 }
예제 #2
0
 public TestDataMain get(String id) {
   TestDataMain testDataMain = super.get(id);
   testDataMain.setTestDataChildList(testDataChildDao.findList(new TestDataChild(testDataMain)));
   return testDataMain;
 }