Merge branch '59-fix-scene-repository-2' into 'dev'

fix scene repository

Closes #59

See merge request sa4-2020/the-sanmarinoes/backend!83
This commit is contained in:
Matteo Omenetti 2020-04-24 23:13:34 +02:00
commit fc25177a69

View file

@ -14,9 +14,9 @@ public interface SceneRepository extends CrudRepository<Scene, Long> {
* @param username a User's username * @param username a User's username
* @return an optional scene, empty if none found * @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); 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); List<Scene> findByUsername(String username);
} }