fix scene repository

This commit is contained in:
britea 2020-04-24 23:09:31 +02:00
parent 6a90f478d1
commit 24804d2d82

View file

@ -14,9 +14,9 @@ public interface SceneRepository extends CrudRepository<Scene, Long> {
* @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<Scene> 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<Scene> findByUsername(String username);
}