I have 2 different entities. table1 has a column which is primary key of table2.
both of the tables has respected repository.
If I write below query in one of the repository it gives error
QuerySyntaxException: unexpected token:
@Query("select new stats.UserCountDTO(b.objectiveId, count(b.objectiveId), a.locationCountry)"+
" from UserIdentityEntity a, UserObjectiveEntity b where b.userIdentityId == a.id and b.cId = ?1")
How can I write join queries in this case using spring data jpa?