Need to mark the entity class represents the entity class @Entity
@Table (name = "t_tag") is generated to represent the table name t_tag
@Id represents the primary key @GeneratedValue represent the primary key is automatically incremented two notes need to be noted on the primary key id
How to represent the links between objects? Such as a blog and a blog classification is many relationship between 1) needs to be added in the blog category. The @ManyToOne () Private the Type type; . 2) in the need to add a blog category @OneToMany (the mappedBy = "type") Private Blogs = new new ArrayList List <> (); . 3) Note: the mappedBy = "of the type" need to write a reprint of this end, showing the relationship is ... to maintain
Add need to reprint entity class constructor with no arguments, get, set method, toStriing method (toString method for facilitating output to the log)
Add the following information in the file application.yml