SQL and HQL joins are working