public StandardVertexLabelMaker name(String name) { //Verify name SystemTypeManager.isNotSystemName(TitanSchemaCategory.VERTEXLABEL, name); this.name=name; return this; }
public StandardRelationTypeMaker name(String name) { SystemTypeManager.isNotSystemName(getSchemaCategory(), name); this.name = name; return this; }
@Override public void changeName(TitanSchemaElement element, String newName) { Preconditions.checkArgument(StringUtils.isNotBlank(newName), "Invalid name: %s", newName); TitanSchemaVertex schemaVertex = getSchemaVertex(element); if (schemaVertex.name().equals(newName)) return; TitanSchemaCategory schemaCategory = schemaVertex.valueOrNull(BaseKey.SchemaCategory); Preconditions.checkArgument(schemaCategory.hasName(), "Invalid schema element: %s", element); if (schemaVertex instanceof RelationType) { InternalRelationType relType = (InternalRelationType) schemaVertex; if (relType.getBaseType() != null) { newName = composeRelationTypeIndexName(relType.getBaseType(), newName); } else assert !(element instanceof RelationTypeIndex); TitanSchemaCategory cat = relType.isEdgeLabel() ? TitanSchemaCategory.EDGELABEL : TitanSchemaCategory.PROPERTYKEY; SystemTypeManager.isNotSystemName(cat, newName); } else if (element instanceof VertexLabel) { SystemTypeManager.isNotSystemName(TitanSchemaCategory.VERTEXLABEL, newName); } else if (element instanceof TitanGraphIndex) { checkIndexName(newName); } transaction.addProperty(schemaVertex, BaseKey.SchemaName, schemaCategory.getSchemaName(newName)); updateSchemaVertex(schemaVertex); schemaVertex.resetCache(); updatedTypes.add(schemaVertex); }
public StandardVertexLabelMaker name(String name) { //Verify name SystemTypeManager.isNotSystemName(TitanSchemaCategory.VERTEXLABEL, name); this.name=name; return this; }
public StandardRelationTypeMaker name(String name) { SystemTypeManager.isNotSystemName(getSchemaCategory(), name); this.name = name; return this; }
@Override public void changeName(TitanSchemaElement element, String newName) { Preconditions.checkArgument(StringUtils.isNotBlank(newName), "Invalid name: %s", newName); TitanSchemaVertex schemaVertex = getSchemaVertex(element); if (schemaVertex.name().equals(newName)) return; TitanSchemaCategory schemaCategory = schemaVertex.valueOrNull(BaseKey.SchemaCategory); Preconditions.checkArgument(schemaCategory.hasName(), "Invalid schema element: %s", element); if (schemaVertex instanceof RelationType) { InternalRelationType relType = (InternalRelationType) schemaVertex; if (relType.getBaseType() != null) { newName = composeRelationTypeIndexName(relType.getBaseType(), newName); } else assert !(element instanceof RelationTypeIndex); TitanSchemaCategory cat = relType.isEdgeLabel() ? TitanSchemaCategory.EDGELABEL : TitanSchemaCategory.PROPERTYKEY; SystemTypeManager.isNotSystemName(cat, newName); } else if (element instanceof VertexLabel) { SystemTypeManager.isNotSystemName(TitanSchemaCategory.VERTEXLABEL, newName); } else if (element instanceof TitanGraphIndex) { checkIndexName(newName); } transaction.addProperty(schemaVertex, BaseKey.SchemaName, schemaCategory.getSchemaName(newName)); updateSchemaVertex(schemaVertex); schemaVertex.resetCache(); updatedTypes.add(schemaVertex); }