First, in the @entity annotated class to write a good foreign key relationship.
This @ManyToOne annotation can establish a foreign key relationship, not in their own silly write a private int grades_id; After writing this note, it automatically adds the Classes table to the grades_id field. The little friends were experimenting with their own @manytoone/@ManyToMany/@OneToMany/@OneToOne What effect these annotations would have, haha, I was happy all afternoon.
Two. write custom multi-table query statements in the Jparepository interface
The general syntax is this, the point is that I framed these places, a bit similar to declaring references. Hope can help you, this is I found a day to solve. Saw a lot of great gods of the edge of their own pondering.
Spring Boot learning experience using jparepository annotation custom SQL query database multi-table query