I am using play framework with jpa. I have a model Jobads with 2 functions to findall() findByLocation()
My Model
public class Job
It's happening because that's how HQL queries without a select clause work. Note that these are not valid JPQL queries. JPQL makes the select clause mandatory, and using a select clause would allow you to specify what you want the query to return:
select j from Jobads j join j.city c WHERE c.name LIKE :location