hi!
i have the following problem .. i have two classes mapped like this
classA {
@Id @Column(name = "someCol") Long id;
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "jointable", joinColumns = { @JoinColumn(name = "colA") }, inverseJoinColumns = { @JoinColumn(name = "colB") }) List<ClassB> list;
}
if i do f.ex. a getById() for classA everything works fine. i get the instance with the list correctly filled.
what i didnt manage to do was to use the criteria api to find all ClassA where the list contains the given instance of ClassB ... so what i need is a method in my classADao which is something like
List<ClassA> findByClassB(ClassB instance);
anyone got an idea how to do this?
thx, sascha
|