我有一个名为Conflict的表,该表具有一个主叫冲突的ID,其值来自我的UI。并且我有表Producer,Sales表还包含冲突ID,Producer包含Producer ID,Sales包含sales_id,我这样映射
@Entity
class Conflict{
@Id
@Column(name="conflict_id")
@ManytoOne()
@JoinedColumn(name="conflict_id)
private List<Producer> produer;
@ManytoOne()
@JoinedColumn(name="conflict_id)
private List<Sales > sales ;
and Sales class is
@Entity
class Sales{
@Id
@Column(name="id")
private Long id;
@Column(name="sales_id")
private Long salesid;
@OneToMay(mappedBy="sales")
private Conflict conflict;
and Producer class is like
@Entity
class Producer{
@Id
@Column(name="id")
private Long id
@Column(name="producer_id")
private Long producerId;
@OnetoMany(mappedBy="producer")
private Conflict conflict
}
在这里,我想在冲突表中插入一个新行,并希望基于sales_id和producer_id更新具有冲突ID的Sales和Producer表, 任何人请提出我如何实现此功能