fixes in wrapping jpa queries