if (utx.getStatus()==Status.STATUS_MARKED_ROLLBACK) {
LOGGER.error("Import marqué comme rollback");
break;
}
EntityJPA entity = parser.next();
if (entity != null) {
LOGGER.debug("Entity parsed: {}", entity.toString());
completeLocation(entity);
if (mode== Mode.DELETE_INSERT) {
defaultDAO.persist(entity);
} else {
// recuperation de l'entity en base
Query query = defaultDAO.getEntityManager().createQuery("select l.id from "+entity.ENTITY_NAME+" where l.name=?1 and l.country=?2");
Long entityId =(Long) query.getSingleResult();
entity.setId(entityId);
defaultDAO.merge(entity);
}
count++;
if (count % BATCH_SIZE == 0) {
em.flush();