/** {@inheritDoc} */ @Assembly @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Override public T findByCode(final String code) { final List<T> entities = genericDAO.findByCode(getEntityClass(), code, MatchMode.EXACT); return entities.size() == 0 ? null : entities.get(0); }
/** {@inheritDoc} */ @Assembly @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Override public List<T> findAll() { return genericDAO.findAll(getEntityClass()); }
/** {@inheritDoc} */ @Assembly @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Override public List<T> findByDescription(final String description) { return genericDAO.findByDescription(getEntityClass(), description, MatchMode.ANYWHERE); }
/** {@inheritDoc} */ @Assembly @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Override public T findById(final Integer id) { return genericDAO.findById(getEntityClass(), id); }
/** {@inheritDoc} */ @Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Override public void delete(final Integer id) { genericDAO.delete(genericDAO.findById(getEntityClass(), id)); }
/** {@inheritDoc} */ @Transactional(propagation = Propagation.REQUIRED, readOnly = false) @Override public T saveOrUpdate(final T entity) { return genericDAO.merge(entity); }