diff options
author | terminaldweller <thabogre@gmail.com> | 2022-06-03 14:48:38 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-06-03 14:48:38 +0000 |
commit | 6496bfe08c2c5bae024ae942ed743a5266b30e6d (patch) | |
tree | 542867a6236bc28362956bf307d96d1135335497 /src/main/java/com/terminaldweller/doc/DocRepository.java | |
parent | wip (diff) | |
download | mdrtl-6496bfe08c2c5bae024ae942ed743a5266b30e6d.tar.gz mdrtl-6496bfe08c2c5bae024ae942ed743a5266b30e6d.zip |
wip, the crud is working, now have to figure out how to update and save the actual text
Diffstat (limited to '')
-rw-r--r-- | src/main/java/com/terminaldweller/doc/DocRepository.java | 3 |
1 files changed, 3 insertions, 0 deletions
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<Doc, Long> { @Query("SELECT d FROM Doc d WHERE d.name = ?1") Optional<Doc> findDocByName(String name); + + @Query("SELECT d FROM Doc d WHERE d.id = ?1") + Optional<Doc> findDocById(Long id); } |