コード例 #1
0
  /** 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;
  }
コード例 #2
0
 /** Finds all document type dtos */
 @Transactional(readOnly = true)
 @Override
 public Collection<DocumentTypeDto> findAllTypes() {
   return documentTypeAssembler.domainsToDtos(documentTypeDao.findAllTypes());
 }
コード例 #3
0
 /** Finds a document type dto */
 @Transactional(readOnly = true)
 @Override
 public DocumentTypeDto findByName(String typeName) {
   return documentTypeAssembler.domainToDto(documentTypeDao.findByName(typeName));
 }