Set<OIdentifiable> values = map.get(iKey);
checkForOptimization();
if (values == null)
values = new ORecordLazySet(configuration.getDatabase()).setRidOnly(true).setRidOnly(true);
else if (values.size() == 1) {
// CHECK IF THE ID IS THE SAME OF CURRENT: THIS IS THE UPDATE CASE
if (!values.contains(iSingleValue))
throw new OIndexException("Found duplicated key '" + iKey + "' on unique index '" + name + "' for record "
+ iSingleValue.getIdentity() + ". The record already present in the index is "