Tag: ee eclipselink

请解释一下:insertable = false,updatable = false

如果一个字段被注释为insertable=false, updatable=false ,那么这是不是意味着你不能插入值,也不能改变现有的值? 你为什么想这么做? @Entity public class Person { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToMany(mappedBy="person", cascade=CascadeType.ALL) private List<Address> addresses; } @Entity public class Address { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @ManyToOne @JoinColumn(name="ADDRESS_FK") @Column(insertable=false, updatable=false) private Person person; }