From 6496bfe08c2c5bae024ae942ed743a5266b30e6d Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 3 Jun 2022 19:18:38 +0430 Subject: wip, the crud is working, now have to figure out how to update and save the actual text --- src/main/java/com/terminaldweller/doc/DocRepository.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/com/terminaldweller/doc/DocRepository.java') diff --git a/src/main/java/com/terminaldweller/doc/DocRepository.java b/src/main/java/com/terminaldweller/doc/DocRepository.java index 387835e..56db04e 100644 --- a/src/main/java/com/terminaldweller/doc/DocRepository.java +++ b/src/main/java/com/terminaldweller/doc/DocRepository.java @@ -10,4 +10,7 @@ import org.springframework.stereotype.Repository; public interface DocRepository extends JpaRepository { @Query("SELECT d FROM Doc d WHERE d.name = ?1") Optional findDocByName(String name); + + @Query("SELECT d FROM Doc d WHERE d.id = ?1") + Optional findDocById(Long id); } -- cgit v1.2.3