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 | |
---|
1 | package com.example.baza.repository;
|
---|
2 |
|
---|
3 |
|
---|
4 | import com.example.baza.model.Knigi;
|
---|
5 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
6 | import org.springframework.data.jpa.repository.Query;
|
---|
7 | import org.springframework.stereotype.Repository;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 | import java.util.Optional;
|
---|
11 |
|
---|
12 | @Repository
|
---|
13 | public 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.