예제 #1
0
 /**
  * Retorna um sabor cadastrado pelo id;
  *
  * @param id
  * @return Sabor.
  * @throws br.edu.ifpb.daca.validation.DacaServiceException
  */
 @Transactional(
     rollbackOn = {DacaException.class},
     value = Transactional.TxType.SUPPORTS)
 public Sabor getById(Long id) throws DacaServiceException {
   try {
     return saborDao.getById(id);
   } catch (DacaPersistenceException ex) {
     throw new DacaServiceException(ex.getMessage(), ex);
   }
 }
예제 #2
0
 @Transactional(
     rollbackOn = {DacaException.class},
     value = Transactional.TxType.SUPPORTS)
 public boolean isInPizzaAssociation(Sabor sabor) throws DacaServiceException {
   try {
     return saborDao.isInPizzaAssociation(sabor);
   } catch (DacaPersistenceException ex) {
     throw new DacaServiceException(ex.getMessage(), ex);
   }
 }
예제 #3
0
 /**
  * Exclui um sabor.
  *
  * @param sabor.
  * @throws br.edu.ifpb.daca.validation.DacaServiceException
  */
 @Transactional(
     rollbackOn = {DacaException.class},
     value = Transactional.TxType.REQUIRED)
 public void delete(Sabor sabor) throws DacaServiceException {
   try {
     saborDao.delete(sabor);
   } catch (DacaPersistenceException ex) {
     throw new DacaServiceException(ex.getMessage(), ex);
   }
 }
예제 #4
0
 /**
  * Recupera todos os sabores disponíveis cadastrados.
  *
  * @return List of disponível Sabores
  * @throws br.edu.ifpb.daca.validation.DacaServiceException
  */
 @Transactional(
     rollbackOn = {DacaException.class},
     value = Transactional.TxType.SUPPORTS)
 public List<Sabor> getAllDisponivel() throws DacaServiceException {
   try {
     return saborDao.getAllDisponivel();
   } catch (DacaPersistenceException ex) {
     throw new DacaServiceException(ex.getMessage(), ex);
   }
 }