Noticed a change in Listeners where EntityManager has been passed as a parameter
public class ProductionGrLinesListener implements BeforeDeleteEntityListener<ProductionGrLines>, BeforeInsertEntityListener<ProductionGrLines>, BeforeUpdateEntityListener<ProductionGrLines> {
@Inject
private Persistence persistence;
@Inject
private Metadata metadata;
@Override
public void onBeforeDelete(ProductionGrLines entity, EntityManager entityManager) {
updateDeleteBalance(entity);
}
what is the exact change, do I have to use this entity manager instead of calling from as follows:
private void updateInsertBalance(JournalDetail operation) {
EntityManager em = persistence.getEntityManager();
....
}
Or both should work?