aboutsummaryrefslogblamecommitdiffstats
path: root/src/main/java/com/terminaldweller/doc/DocRepository.java
blob: 56db04e4a2fd256befbed211f722dc1dbea5d285 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                 


                                               
 
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);

  @Query("SELECT d FROM Doc d WHERE d.id = ?1")
  Optional<Doc> findDocById(Long id);
}