package com.justjournal.repository;

import com.justjournal.model.Journal;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * Journal Repository
 * @author Lucas Holt
 */
@Repository
public interface JournalRepository extends JpaRepository<Journal, Integer> {

    Journal findOneBySlug(@Param("slug") String slug);
}

@@ -68,16 +68,51 @@
 ournal;%0A
+import com.justjournal.model.User;%0A
 import o
@@ -165,16 +165,70 @@
 sitory;%0A
+import org.springframework.data.jpa.repository.Query;%0A
 import o
@@ -326,16 +326,40 @@
 itory;%0A%0A
+import java.util.List;%0A%0A
 /**%0A * J
@@ -376,16 +376,19 @@
 ository%0A
+ *%0A
  * @auth
@@ -495,16 +495,16 @@
 ger%3E %7B%0A%0A
-
     Jour
@@ -549,11 +549,246 @@
 g slug);
+%0A%0A    List%3CJournal%3E findByUser(@Param(%22user%22) User user);%0A%0A    @Query(%22select ul from Journal ul, User u where ul.user = u and LOWER(u.username) = LOWER(:username)%22)%0A    List%3CJournal%3E findByUsername(@Param(%22username%22) String username);
 %0A%7D%0A

add methods to find by user