コード例 #1
0
 @Override
 public Information findInformationByUuid(String uuid) {
   try {
     Information information = informationDao.get(uuid);
     return information;
   } catch (CustomException e) {
     e.printStackTrace();
   }
   return null;
 }
コード例 #2
0
 @Override
 @Transactional(propagation = Propagation.REQUIRED)
 public void deleteInformation(String uuid) {
   try {
     Information information = informationDao.load(uuid);
     information.setDeleteDate(new Date());
     informationDao.update(information);
   } catch (CustomException e) {
     e.printStackTrace();
   }
 }
コード例 #3
0
  @Override
  @Transactional(propagation = Propagation.REQUIRED)
  public void updateInformation(Information information) {
    try {
      Information tmp = informationDao.get(information.getUuid());
      tmp.setTitle(information.getTitle());
      tmp.setPictureUrl(information.getPictureUrl());
      tmp.setAuthorName(information.getAuthorName());
      tmp.setSummary(information.getSummary());
      tmp.setModifyDate(new Date());
      if (tmp instanceof InformationText) {
        ((InformationText) tmp).setContent(((InformationText) information).getContent());
      }

      informationDao.update(information);
    } catch (CustomException e) {
      e.printStackTrace();
      this.saveInformation(information);
    }
  }