}
log.warn(String.format("%s with id %s exists in the directory but not on the data node. Directory record removed.", config.getResourceName(), id));
}
public T save(final T entity) {
SessionCallback callback = transactionHelper.newSaveCallback(entity, getRespresentedClass());
SessionCallback cleanupCallback = new SessionCallback() {
public void execute(Session session) {
session.refresh(entity);
session.lock(getRespresentedClass().getName(), entity, LockMode.UPGRADE);
session.update(getRespresentedClass().getName(), entity);
log.warn(String.format("%s with id %s exists in the data node but not on the directory. Data node record was updated and re-indexed.", config.getResourceName(), config.getId(entity)));