diff options
Diffstat (limited to 'src/main/java/com/terminaldweller/doc/DocRepository.java')
-rw-r--r-- | src/main/java/com/terminaldweller/doc/DocRepository.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/terminaldweller/doc/DocRepository.java b/src/main/java/com/terminaldweller/doc/DocRepository.java new file mode 100644 index 0000000..387835e --- /dev/null +++ b/src/main/java/com/terminaldweller/doc/DocRepository.java @@ -0,0 +1,13 @@ +package com.terminaldweller.doc; + +import java.util.Optional; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +/** The interface of the doc class for the data store. */ +@Repository +public interface DocRepository extends JpaRepository<Doc, Long> { + @Query("SELECT d FROM Doc d WHERE d.name = ?1") + Optional<Doc> findDocByName(String name); +} |