use of com.axelor.apps.base.db.SyncContactHistoric in project axelor-open-suite by axelor.
the class SyncContactService method importAllContact.
public void importAllContact(Long id, List<Person> people) {
int i = 0;
SyncContact syncContact = syncContactRepo.find(id);
if (syncContact == null) {
return;
}
SyncContactHistoric syncContactHistoric = new SyncContactHistoric();
for (Person googlePerson : people) {
Partner partner = importContact(googlePerson, syncContact.getUpdateContactField());
if (partner != null) {
syncContactHistoric.addPartnerSetItem(partner);
}
if (i % 10 == 0) {
JPA.clear();
}
i++;
}
updateSyncContact(id, syncContactHistoric);
}
Aggregations