Solution for task 1 (jpql quert)
Solution for task 2 criteria api