Last change
on this file since 6fe77af was b738035, checked in by Ema <ema_spirova@…>, 3 years ago |
signup/login server errors on front and remove location from planner
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | package finki.diplomska.tripplanner.repository.jpa;
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | import finki.diplomska.tripplanner.models.Planner;
|
---|
| 5 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
[84d0fbb] | 6 | import org.springframework.data.jpa.repository.Query;
|
---|
| 7 | import org.springframework.data.repository.query.Param;
|
---|
[6a3a178] | 8 | import org.springframework.stereotype.Repository;
|
---|
| 9 |
|
---|
| 10 | import java.util.List;
|
---|
| 11 |
|
---|
| 12 | @Repository
|
---|
| 13 | public interface JpaPlannerRepository extends JpaRepository<Planner, Long> {
|
---|
| 14 |
|
---|
[84d0fbb] | 15 | @Query(value = "SELECT * FROM planners AS p left JOIN users AS u ON p.user_id = u.id WHERE u.username like :username", nativeQuery = true)
|
---|
| 16 | List<Planner> getPlannersByUser(@Param("username") String username );
|
---|
[bdd6491] | 17 |
|
---|
[b738035] | 18 | @Query(value = "DELETE planners_contain " +
|
---|
| 19 | "FROM planners_contain " +
|
---|
| 20 | "JOIN planners ON planners_contain.id_planner = planners.id_planner " +
|
---|
| 21 | "JOIN locations ON planners_contain.id_location = locations.id_location " +
|
---|
| 22 | "WHERE planners_contain.id_planner = :plannerId AND planners_contain.id_location = :locationId", nativeQuery = true)
|
---|
| 23 | void deleteLocationFromPlanner(@Param("plannerId") Long plannerId, @Param("locationId") Long locationId);
|
---|
[6a3a178] | 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.