package me.bbb1991.dao;

import me.bbb1991.model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by bbb1991 on 12/9/16.
 * DAO для работы с книгой
 *
 * @author Bagdat Bimaganbetov
 * @author bagdat.bimaganbetov@gmail.com
 */
public interface BookDAO extends JpaRepository<Book, Long> {

    @Query("SELECT b FROM Book b where b.author.username=:username")
    List<Book> findByUsername(@Param("username") String username);

}
@@ -451,16 +451,216 @@
 ong%3E %7B%0A%0A
+    /**%0A     * %D0%9F%D0%BE%D0%BB%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5 %D0%B2%D1%81%D0%B5%D1%85 %D0%BA%D0%BD%D0%B8%D0%B3 %D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B0, %D0%B8%D1%81%D0%BA%D0%BB%D1%8E%D1%87%D0%B0%D1%8F %D0%BA%D0%BD%D0%B8%D0%B3%D0%B8, %D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5 %D0%B5%D1%89%D0%B5 %D0%BD%D0%B5 %D0%B7%D0%B0%D0%BA%D0%BE%D0%BD%D1%87%D0%B5%D0%BD%D1%8B, %D1%82%D0%BE %D0%B5%D1%81%D1%82%D1%8C %D0%BF%D0%BE%D0%BC%D0%B5%D1%87%D0%B5%D0%BD%D1%8B %D0%BA%D0%B0%D0%BA %D1%87%D0%B5%D1%80%D0%BD%D0%BE%D0%B2%D0%B8%D0%BA%0A     *%0A     * @param username %D0%BB%D0%BE%D0%B3%D0%B8%D0%BD %D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B0%0A     * @return %D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA %D0%BA%D0%BD%D0%B8%D0%B3 %D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B0%0A     */%0A
     @Que
@@ -717,16 +717,34 @@
 username
+ and b.draft=false
 %22)%0A    L

Add some JavaDOC