我忽略了通过@Transient
注释在实体类中保存变量。此后我面临的问题是无法使用JACKSON将其序列化为JSON。
@Data
@Entity (name = "Pick")
@Table (name = "pick")
public class Pick {
@Id
@Column (name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column (name = "vID")
private Integer vD;
@Column (name = "sID")
private Integer sID;
@Column (name = "rID")
private Integer rID;
@Column (name = "status")
private String status;
@Column (name = "category")
private String category;
@OneToMany
@JoinColumn (name = "PickID")
@Transient
private List<Page> Pages;
}