Fixed JPA sql query