addAssignmentsInPersistence(Sets.newHashSet(assignment));
}
private void addAssignmentsInPersistence(Collection<Assignment> assignments) {
preparePersistenceAccess();
EKBCommit commit = getEKBCommit();
for (Assignment assignment : assignments) {
List<Assignment> result =
queryService.queryByString(Assignment.class, "uuid:\"" + assignment.getUuid() + "\"");
if (result.size() == 0) {
LOGGER.debug("New Assignment: " + assignment.getUser() + ":" + assignment.getProject());
commit.addInsert(assignment);
} else {
LOGGER.debug("Update Assignment: " + assignment.getUser() + ":" + assignment.getProject());
commit.addUpdate(assignment);
}
}
persistService.commit(commit);
revokePersistenceAccess();