Java 联接列左空
我有两门课。 第一: 我需要将一些多边形连接到一个区域 当我用jparepository插入新数据时,连接列左空。Java 联接列左空,java,hibernate,jpa,Java,Hibernate,Jpa,我有两门课。 第一: 我需要将一些多边形连接到一个区域 当我用jparepository插入新数据时,连接列左空。 如何修复它?需要删除JPA属性中的insertable=false,updateable=false @Entity @Table(name = "region", schema="building") public class Region { /** * id */ @Id @Column(name = "regionid")
如何修复它?需要删除JPA属性中的
insertable=false,updateable=false
@Entity
@Table(name = "region", schema="building")
public class Region {
/**
* id
*/
@Id
@Column(name = "regionid")
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "regionid", referencedColumnName = "regionid", insertable = false, updatable = false)
private List<Polygon> polygonsList;
}
@Entity
@Table(name = "polygon", schema="building")
public class Polygon {
/**
* id
*/
@Id
@Column(name = "polygonid")
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
}