@Override public void addVertexIndex(String indexName, Class<?> clazzOfVertices, boolean unique, String fieldKey, FieldType fieldType) { if (log.isDebugEnabled()) { log.debug("Adding vertex index for class {" + clazzOfVertices.getName() + "}"); } OrientGraphNoTx noTx = rawNoTx(); try { String name = clazzOfVertices.getSimpleName(); OrientVertexType v = noTx.getVertexType(name); if (v == null) { throw new RuntimeException("Vertex type {" + name + "} is unknown. Can't create index {" + indexName + "}"); } if (v.getProperty(fieldKey) == null) { OType type = toType(fieldType); OType subType = toSubType(fieldType); if (subType != null) { v.createProperty(fieldKey, type, subType); } else { v.createProperty(fieldKey, type); } } if (v.getClassIndex(indexName) == null) { v.createIndex(indexName, unique ? OClass.INDEX_TYPE.UNIQUE_HASH_INDEX.toString() : OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString(), null, new ODocument().fields("ignoreNullValues", true), new String[] { fieldKey }); } } finally { noTx.shutdown(); } }