public OPropertyIndex setIndex(final OIndex iIndex) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
final String cmd = String.format("alter property %s index %s", getFullName(), iIndex.getIdentity());
getDatabase().command(new OCommandSQL(cmd)).execute();
final OIndex idx = getDatabase().getMetadata().getIndexManager().getIndex(iIndex.getIdentity());
index = new OPropertyIndex(idx, new String[] { name });
return index;
}