complex JPQL working example