fix in automation repo

This commit is contained in:
omenem 2020-05-09 16:55:47 +02:00
parent 628edfd76f
commit a24b30ce19

View file

@ -7,9 +7,9 @@ import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
public interface AutomationRepository extends CrudRepository<Automation, Long> {
@EntityGraph(attributePaths = {"scenes", "triggers"})
@EntityGraph(attributePaths = {"scenes", "triggers", "conditions"})
List<Automation> findAllByUserId(@Param("userId") long userId);
@EntityGraph(attributePaths = {"scenes", "triggers"})
@EntityGraph(attributePaths = {"scenes", "triggers", "conditions"})
Optional<Automation> findByIdAndUserId(@Param("id") long id, @Param("userId") long userId);
}