main
Line | |
---|
1 | package com.example.rezevirajmasa.demo.repository;
|
---|
2 |
|
---|
3 | import com.example.rezevirajmasa.demo.model.Restaurant;
|
---|
4 | import com.example.rezevirajmasa.demo.model.TableEntity;
|
---|
5 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
6 | import org.springframework.data.jpa.repository.Query;
|
---|
7 | import org.springframework.data.repository.query.Param;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | public interface RestaurantRepository extends JpaRepository<Restaurant, Long> {
|
---|
12 | List<Restaurant> findAllByNameLikeIgnoreCase(String search);
|
---|
13 | List<Restaurant> findAllByCuisineTypeContaining(String search);
|
---|
14 | @Query("SELECT DISTINCT r.cuisineType FROM Restaurant r")
|
---|
15 | List<String> findAllCuisineTypes();
|
---|
16 | List<Restaurant> findAllByCuisineType(String cuisine);
|
---|
17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.