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


Java OrientBaseGraph.getVertexType方法代码示例

本文整理汇总了Java中com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getVertexType方法的典型用法代码示例。如果您正苦于以下问题:Java OrientBaseGraph.getVertexType方法的具体用法?Java OrientBaseGraph.getVertexType怎么用?Java OrientBaseGraph.getVertexType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tinkerpop.blueprints.impls.orient.OrientBaseGraph的用法示例。


在下文中一共展示了OrientBaseGraph.getVertexType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkIndexUniqueness

import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; //导入方法依赖的package包/类
@Override
public <T extends MeshElement> T checkIndexUniqueness(String indexName, T element, Object key) {
	FramedGraph graph = Tx.getActive().getGraph();
	OrientBaseGraph orientBaseGraph = unwrapCurrentGraph();

	OrientVertexType vertexType = orientBaseGraph.getVertexType(element.getClass().getSimpleName());
	if (vertexType != null) {
		OIndex<?> index = vertexType.getClassIndex(indexName);
		if (index != null) {
			Object recordId = index.get(key);
			if (recordId != null) {
				if (recordId.equals(element.getElement().getId())) {
					return null;
				} else {
					return (T) graph.getFramedVertexExplicit(element.getClass(), recordId);
				}
			}
		}
	}
	return null;
}
 
开发者ID:gentics,项目名称:mesh,代码行数:22,代码来源:OrientDBDatabase.java

示例2: addVertrexType

import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; //导入方法依赖的package包/类
public static void addVertrexType(OrientBaseGraph graph, Class<?> clasz) {

			if (clasz.isAnnotationPresent(DatabaseVertrex.class)) {
				
				
				//Map<String, DatabaseProperty> mapSchemaProperty = new HashMap<String, DatabaseProperty>();

				DatabaseVertrex classAnotation = clasz.getAnnotation(DatabaseVertrex.class);

				String className = clasz.getSimpleName();
				if(StringUtils.isNotBlank(classAnotation.name())) {
					className = classAnotation.name();
				}
				
				
				
				OrientVertexType oClass = graph.getVertexType(className);

				Class<?> parentClass = clasz.getSuperclass();				
				while(!parentClass.isAnnotationPresent(DatabaseVertrex.class) && (parentClass.getSuperclass() != null)) {
					parentClass = parentClass.getSuperclass();				
				}
				
				OrientVertexType oParentClass = graph.getVertexType(parentClass.getSimpleName());
				if (parentClass.getSimpleName().equals(Object.class.getSimpleName())) {
					oParentClass = graph.getVertexBaseType();
				}

				if (oClass == null) {
					logger.warn("Add Vertrex @" + className + " child of @" + oParentClass);
					graph.createVertexType(className, oParentClass.getName());
				} else {
					if (logger.isDebugEnabled())
						logger.debug("Vertrex @" + className + " exist, child of @" + oParentClass);
				}

			}
		}
 
开发者ID:e-baloo,项目名称:it-keeps,代码行数:39,代码来源:DatabaseFactory.java

示例3: initialize

import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; //导入方法依赖的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

示例4: ensureNodeTypeExistence

import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; //导入方法依赖的package包/类
private void ensureNodeTypeExistence( OrientBaseGraph graph, String type ) {
	if( graph.getVertexType( type ) == null ) {
		graph.createVertexType( type );
	}
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:6,代码来源:GDomDB.java


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