コード例 #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
 @Transactional(readOnly = false)
 public void delete(TestDataMain testDataMain) {
   super.delete(testDataMain);
   testDataChildDao.delete(new TestDataChild(testDataMain));
 }
コード例 #3
0
 public TestDataMain get(String id) {
   TestDataMain testDataMain = super.get(id);
   testDataMain.setTestDataChildList(testDataChildDao.findList(new TestDataChild(testDataMain)));
   return testDataMain;
 }