Ignore:
Timestamp:
11/26/21 20:07:18 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
1ad8e64
Parents:
e29cc2e
Message:

disabling to add location if it already exists in the planner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java

    re29cc2e r8d391a1  
    8484    List<Location> getAllLocationsForPlanner(@Param("plannerId") Long plannerId);
    8585
     86
     87    @Query(value = "SELECT l.id_location " +
     88            "FROM locations AS l " +
     89            "WHERE l.id_location IN " +
     90            "(SELECT pl.id_location FROM planners_contain AS pl WHERE pl.id_planner = :plannerId)", nativeQuery = true)
     91    List<Long> getAllLocationIdsForPlanner(@Param("plannerId") Long plannerId);
     92
    8693    @Query(value = "SELECT *, if(l.id_city is NOT NULL, c.city_name, l.location_name) as result " +
    8794            "FROM locations AS l " +
Note: See TracChangeset for help on using the changeset viewer.