From 24804d2d828c3528931a5faf5be651034d74d019 Mon Sep 17 00:00:00 2001 From: britea Date: Fri, 24 Apr 2020 23:09:31 +0200 Subject: [PATCH] fix scene repository --- .../inf/sa4/sanmarinoes/smarthut/models/SceneRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SceneRepository.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SceneRepository.java index de08a53..a4aa68c 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SceneRepository.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SceneRepository.java @@ -14,9 +14,9 @@ public interface SceneRepository extends CrudRepository { * @param username a User's username * @return an optional scene, empty if none found */ - @Query("SELECT r FROM Room r JOIN r.user u WHERE r.id = ?1 AND u.username = ?2") + @Query("SELECT s FROM Scene s JOIN s.user u WHERE s.id = ?1 AND u.username = ?2") Optional findByIdAndUsername(Long id, String username); - @Query("SELECT r FROM Room r JOIN r.user u WHERE u.username = ?1") + @Query("SELECT s FROM Scene s JOIN s.user u WHERE u.username = ?1") List findByUsername(String username); }