java - JPA Findby.<property> in many to many relation -


i have many:many relationship between 2 classes. trying find products customer.

e.g.

class customer { @manytomany @jointable private list<product> products;  } class product {  @manytomany (mappedby="products")  private list<customer> customers;  }   public interface productrepository extends         jparepository<products, integer> {  list<customer> findbyproducts(product aaa);   } 

where "findbyproducts" products property in customer class. in every case getting 0 size list of customers. have tried pass product list no success.

i not sure doing wrong or approach wrong in many many relation. appreciated.

thanks in advance.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -