@@ -0,0 +1,1185 @@
+package cz.muni.fi.pa165.facade;%0A%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0Aimport javax.inject.Inject;%0A%0Aimport org.dozer.Mapper;%0A%0Aimport cz.muni.fi.pa165.dto.BookDTO;%0Aimport cz.muni.fi.pa165.dto.CreateBookDTO;%0Aimport cz.muni.fi.pa165.entity.Book;%0Aimport cz.muni.fi.pa165.enums.BookState;%0Aimport cz.muni.fi.pa165.service.BookService;%0A%0A/**%0A * @author Michael Simacek%0A *%0A */%0Apublic class BookFacadeImpl implements BookFacade %7B%0A%0A    @Inject%0A    Mapper mapper;%0A%0A    @Inject%0A    BookService service;%0A%0A    @Override%0A    public void createBook(CreateBookDTO book) %7B%0A        service.create(mapper.map(book, Book.class));%0A    %7D%0A%0A    @Override%0A    public BookDTO findById(Long id) %7B%0A        return mapper.map(service.findById(id), BookDTO.class);%0A    %7D%0A%0A    @Override%0A    public List%3CBookDTO%3E findAll() %7B%0A        return service.findAll().stream().map(x -%3E mapper.map(x, BookDTO.class)).collect(Collectors.toList());%0A    %7D%0A%0A    @Override%0A    public void delete(Long bookId) %7B%0A        service.delete(service.findById(bookId));%0A    %7D%0A%0A    @Override%0A    public void setState(Long bookId, BookState newState) %7B%0A        service.setState(service.findById(bookId), newState);%0A    %7D%0A%0A%7D%0A

Add BookFacade implementation