本文整理汇总了Java中com.tinkerpop.blueprints.impls.orient.OrientVertexType.createProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OrientVertexType.createProperty方法的具体用法?Java OrientVertexType.createProperty怎么用?Java OrientVertexType.createProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tinkerpop.blueprints.impls.orient.OrientVertexType
的用法示例。
在下文中一共展示了OrientVertexType.createProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Auditor
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
public Auditor(Transaction t, String user) {
this.transaction = t;
this.auditUser = user;
// verificar que la clase de auditorías exista
if (this.transaction.getDBClass(this.ODBAUDITLOGVERTEXCLASS) == null) {
OrientVertexType olog = this.transaction.getGraphdb().createVertexType(this.ODBAUDITLOGVERTEXCLASS);
olog.createProperty("rid", OType.STRING);
olog.createProperty("timestamp", OType.DATETIME);
olog.createProperty("user", OType.STRING);
olog.createProperty("action", OType.STRING);
olog.createProperty("label", OType.STRING);
olog.createProperty("log", OType.STRING);
this.transaction.commit();
}
}
示例2: initialize
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
@Override
public void initialize() {
final OrientBaseGraph db = context.getConnection();
/**
* Avoid creating scheme if table already exist.
* Look method implementation: internally it use document api the same way as it was used in
* document sample.
*/
if (db.getVertexType(CLASS_NAME) != null) {
return;
}
/**
* In database scheme the only difference with other apis would be that
* Sample class would extend "V" in scheme (which marks type as Vertex type).
*/
final OrientVertexType vtype = db.createVertexType(CLASS_NAME);
vtype.createProperty("name", OType.STRING);
vtype.createProperty("amount", OType.INTEGER);
// registration of graph type is not mandatory (orient will create it on-the-fly)
// but with warning
// also note that edge name is case-insensitive and so used as "belongsTo" everywhere in code
db.createEdgeType("BelongsTo");
}
示例3: addVertexIndex
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
@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 = factory.getNoTx();
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 = convertType(fieldType);
OType subType = convertToSubType(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();
}
}
示例4: setupTypesAndIndices
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
private static void setupTypesAndIndices(OrientGraphFactory factory2) {
OrientGraph g = factory.getTx();
try {
// g.setUseClassForEdgeLabel(true);
g.setUseLightweightEdges(false);
g.setUseVertexFieldsForEdgeLabels(false);
} finally {
g.shutdown();
}
try {
g = factory.getTx();
OrientEdgeType e = g.createEdgeType("HAS_ITEM");
e.createProperty("in", OType.LINK);
e.createProperty("out", OType.LINK);
e.createIndex("e.has_item", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "out", "in");
OrientVertexType v = g.createVertexType("root", "V");
v.createProperty("name", OType.STRING);
v = g.createVertexType("item", "V");
v.createProperty("name", OType.STRING);
v.createIndex("item", OClass.INDEX_TYPE.FULLTEXT_HASH_INDEX, "name");
} finally {
g.shutdown();
}
}
示例5: init
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
@BeforeClass
public void init() {
initDB();
graph = new OrientGraph((ODatabaseDocumentTx) databaseDocumentTx, false);
OrientVertexType type = graph.createVertexType("City");
type.createProperty("latitude", OType.DOUBLE);
type.createProperty("longitude", OType.DOUBLE);
type.createProperty("name", OType.STRING);
databaseDocumentTx.command(new OCommandSQL("create index City.name on City (name) FULLTEXT ENGINE LUCENE")).execute();
}
示例6: init
import com.tinkerpop.blueprints.impls.orient.OrientVertexType; //导入方法依赖的package包/类
@BeforeClass
public void init() {
initDB();
OrientGraph graph = new OrientGraph((ODatabaseDocumentTx) databaseDocumentTx, false);
OrientVertexType type = graph.createVertexType("City");
type.createProperty("name", OType.STRING);
databaseDocumentTx.command(new OCommandSQL("create index City.name on City (name) FULLTEXT ENGINE LUCENE")).execute();
}