Last change
on this file was 76712b2, checked in by Ema <ema_spirova@…>, 2 years ago |
search all locations by city or region
|
-
Property mode
set to
100644
|
File size:
602 bytes
|
Line | |
---|
1 | package finki.diplomska.tripplanner.repository.jpa;
|
---|
2 |
|
---|
3 | import finki.diplomska.tripplanner.models.Region;
|
---|
4 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
5 | import org.springframework.data.jpa.repository.Query;
|
---|
6 | import org.springframework.stereotype.Repository;
|
---|
7 |
|
---|
8 | import java.util.List;
|
---|
9 |
|
---|
10 | @Repository
|
---|
11 | public interface JpaRegionRepository extends JpaRepository<Region, Long> {
|
---|
12 |
|
---|
13 | @Query(value="SELECT r.region_name " +
|
---|
14 | "FROM regions AS r " +
|
---|
15 | "UNION all " +
|
---|
16 | "SELECT c.city_name FROM cities AS c", nativeQuery = true)
|
---|
17 | List<String> getAllCitiesAndRegions();
|
---|
18 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.