source: src/main/java/com/example/baza/repository/KnigiRepository.java

Last change on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 835 bytes
Line 
1package com.example.baza.repository;
2
3
4import com.example.baza.model.Knigi;
5import org.springframework.data.jpa.repository.JpaRepository;
6import org.springframework.data.jpa.repository.Query;
7import org.springframework.stereotype.Repository;
8
9import java.util.List;
10import java.util.Optional;
11
12@Repository
13public interface KnigiRepository extends JpaRepository<Knigi, Integer> {
14 long countById(Integer id);
15
16 Optional<Knigi> findById(Integer integer);
17
18 List<Knigi> findByNaslov(String naslov);
19
20 boolean existsById(Integer integer);
21
22 void deleteById(Integer integer);
23
24 List<Knigi> findByOpisLike(String opis);
25
26 //List<Knigi> findByAvtorLike(String ime);
27 @Query(value = "select naslov from knigi where (upper(naslov) like '%text%');\n", nativeQuery = true)
28 List<Knigi> findByNaslovLike(String text);
29
30}
Note: See TracBrowser for help on using the repository browser.