use of jetbrains.exodus.core.dataStructures.hash.LinkedHashMap in project xodus by JetBrains.
the class UniqueKeyIndicesEngine method getUniqueKeyIndexName.
private String getUniqueKeyIndexName(@NotNull final Index index) {
final List<IndexField> fields = index.getFields();
final int fieldCount = fields.size();
if (fieldCount < 1) {
throw new EntityStoreException("Can't define unique key on empty set of fields");
}
final LinkedHashMap<String, Boolean> names = new LinkedHashMap<>();
for (final IndexField field : fields) {
final String name = field.getName();
final Boolean b = names.get(name);
if (b != null && b == field.isProperty()) {
throw new EntityStoreException("Can't define unique key, field is used twice: " + name);
}
names.put(name, field.isProperty());
}
return getUniqueKeyIndexName(index.getOwnerEntityType(), names);
}
Aggregations