Home > Back-end >  How do you write JPA two join specification?
How do you write JPA two join specification?

Time:12-19

Teachers
Two tables have a product, the tag
Product_tag_mapping product_id, tag_id fields and, of course, other fields, and is not a simple things to many intermediate table

Product_tag_mapping wrote
 @ ManyToOne 
@ JoinColumn (name="product_id")
Private Product Product;
@ ManyToOne
@ JoinColumn (name="tag_id")
Private Tag Tag;


Now query tagid=999 with the method of the specification of the product, should be how to write?
thank you
  • Related