我有下面的实体对象,我在一个事务中修改对象并调用另一个来保持它。
我的问题是在调用persist方法之前调用Select S_OFFERS_GENERATOR.nextVal,为什么在JPA中调用pesist之前调用序列?
注意:实时我有更多成员
Public Class BckOffer{
@Id
@SequenceGenerator(name = "S_OFFERS_GENERATOR", sequenceName = "SEQ_BCK_OFFER_ID", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S_OFFERS_GENERATOR")
@Column(name = "BCK_OFFER_ID")
private Long bckOfferId;
}