I have 3 tables named School, SchoolType and Country. You can see the relationship between School and SchoolType. What I want to query is;
Select countries which has same id with Schooltypes that has at least one school named "blabla".
My School class;
@JoinColumn(name = "school_type_ref", referencedColumnName = "school")
@ManyToOne(cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
private SchoolType schooltype;
My SchoolType Class;
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, mappedBy = "schooltype")
private List<School> schoolList;
private String id;
My Country Class;
private String id;