I have the following issues.
There is a distributor of the organization, which is associated with the attitude of ManyToMany to the city of persons:
@Entity public class Distributor{ @ManyToMany @JoinTable( name = "GS_DISTRIBUTOR_TOWN", joinColumns = @JoinColumn(name = "CD_DISTRIBUTOR"), inverseJoinColumns = @JoinColumn(name = "CD_TOWN") ) private List<Town> towns; .... }
Then the city of the object also refers to the county
@Entity public class Town{ @ManyToMany(mappedBy="towns") private List<Distributor> distributors; @ManyToOne private District district; .... }
Now I have to filter (with jpql) all the distributors who are in the county. How can i do this?
source share