当前位置: 首页>>代码示例>>Java>>正文


Java OrientVertexType.createProperty方法代码示例

本文整理汇总了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();
    }
    
}
 
开发者ID:mdre,项目名称:odbogm,代码行数:18,代码来源:Auditor.java

示例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");
}
 
开发者ID:xvik,项目名称:guice-persist-orient-examples,代码行数:29,代码来源:ManualSchemeInitializer.java

示例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();
	}

}
 
开发者ID:gentics,项目名称:mesh,代码行数:33,代码来源:OrientDBDatabase.java

示例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();
	}

}
 
开发者ID:gentics,项目名称:mesh,代码行数:31,代码来源:EdgeIndexPerformanceTest.java

示例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();
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:12,代码来源:GraphEmbeddedTest.java

示例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();
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:11,代码来源:LuceneIndexCreateDropTest.java


注:本文中的com.tinkerpop.blueprints.impls.orient.OrientVertexType.createProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。