Solution for task 1 jpql and task 2 criteria api of 2013-04