postgresql+eclipselink

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?

// update a detached entity
a5 =em.merge(a4);
.. make changes to a5
em.flush();
em.refresh(a5);


// persist a new entity
em.persist(a4);
em.flush();
em.refresh(a4)

thank very much