i have 2 Entities with the following Metamodels.
@StaticMetamodel(SearchIn.class)
public class SearchIn_ {
public static volatile SingularAttribute<SearchIn, Integer> id;
public static volatile SingularAttribute<SearchIn, String> searchString;
public static volatile SetAttribute<SearchIn, Take> takes;
// Other Attributes...
}
@StaticMetamodel(Take.class)
public class Take_ {
public static volatile SingularAttribute<Take, Integer> id;
// Other Attributes...
}
The relationship is a ManyToMany mapped by SearchIn.Class and Take.Class has no referene to SearchIn.Class.
What i need now is all Takes that are mapped to a SearchIn with a specific searchString. I want to use the criteria api but i can't figure out which entitity i need as Root and how to do the joins with that. I saw some other questions that are similar but not realy what i want and i dont get it to work :/
So can somone give me a Hint and help me to build this up?