@Override @Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.SERIALIZABLE) public String updateShop(ShopFormDTO shopFormDTO) { Shop shop = shopFormDTO.toShop(); shopDao.saveOrUpdate(shop); return shop.getGuid(); }
@Override @Transactional public void work() { Shop shop = new Shop(); shopDao.saveOrUpdate(shop); Worker worker = workerFactory.create(); worker.work(30); // throw new UnsupportedOperationException("Check whether the worker is committed or // rollback~~~"); }
@Override @Transactional(readOnly = true) public List<ExamineDTO> loadExamines() { List<ExamineDTO> examineDTOs = new ArrayList<ExamineDTO>(); List<Examine> examines = shopDao.findAll(Examine.class); for (Examine examine : examines) { ExamineDTO examineDTO = new ExamineDTO(examine); examineDTOs.add(examineDTO); } return examineDTOs; }
@Override @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT) public Shop loadShopByGuid(String guid) { return shopDao.findByGuid(Shop.class, guid); }
@Override @Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT) public void saveOrUpdateExamine(ExamineDTO examineDTO) { Examine examine = examineDTO.toExamine(); shopDao.saveOrUpdate(examine); }
@Override @Transactional(readOnly = true) public List search() throws InterruptedException { return shopDao.search(); }
@Override @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true) public List<ShopOverviewDTO> loadShops() { return shopDao.findShops(); }
@Override public CommentAttachment loadCommentAttachment(String guid) { return shopDao.findByGuid(CommentAttachment.class, guid); }
@Override public void saveOrUpdateAttachment(CommentAttachment attachment) { shopDao.saveOrUpdate(attachment); }