/** Creates a document type using DocumentTypeDto */ @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) @Override public Object create(DocumentTypeDto dto) throws EntityAlreadyFoundException { Integer documentTypePk; if (documentTypeDao.findByName(dto.getName()) == null) throw new EntityAlreadyFoundException(); documentTypePk = documentTypeDao.persist(documentTypeAssembler.dtoToDomain(dto)); return documentTypePk; }
/** Finds all document type dtos */ @Transactional(readOnly = true) @Override public Collection<DocumentTypeDto> findAllTypes() { return documentTypeAssembler.domainsToDtos(documentTypeDao.findAllTypes()); }
/** Finds a document type dto */ @Transactional(readOnly = true) @Override public DocumentTypeDto findByName(String typeName) { return documentTypeAssembler.domainToDto(documentTypeDao.findByName(typeName)); }