Customer class:
@Id
@SequenceGenerator(name=“CUSTID_GENERATOR”, sequenceName=“CUST_PK_SEQ”,allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator=“CUSTID_GENERATOR”)
private Integer custid;
public Integer getCustid() {
return this.custid;
}
public void setCustid(Integer custid) {
this.custid= custid;
}
UI class:
private FieldGroup editorFields = new FieldGroup();
……
// bind code
editorFields.commit();
Customer a4 = ((BeanItem) editorFields.getItemDataSource()).getBean();
EntityManager em = JPAContainerFactory
.createEntityManagerForPersistenceUnit(Sys.PERSISTENCE_UNIT);
em.getTransaction().begin();
em.merge(a4);
em.getTransaction().commit();
how can I get the new
custid
value?