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


Java OrientBaseGraph.getEdgeType方法代码示例

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


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

示例1: addEdgeType

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

			if (clasz.isAnnotationPresent(DatabaseEdge.class)) {

				//DatabaseEdge classAnotation = clasz.getAnnotation(DatabaseEdge.class);

				OrientEdgeType oClass = graph.getEdgeType(clasz.getSimpleName());

				OrientEdgeType oClassParent = graph.getEdgeType(clasz.getSuperclass().getSimpleName());
				if (clasz.getSuperclass().getSimpleName().equals(Object.class.getSimpleName())) {
					oClassParent = graph.getEdgeBaseType();
				}

				if (oClass == null) {
					logger.warn("Add Edge @" + clasz.getSimpleName() + " child of @" + oClassParent);
					graph.createEdgeType(clasz.getSimpleName(), oClassParent.getName());
				} else {
					if (logger.isDebugEnabled())
						logger.debug("Edge @" + clasz.getSimpleName() + " exist, child of @" + oClassParent);
				}

			}

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

示例2: edgeLookup

import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; //导入方法依赖的package包/类
@Override
public List<Object> edgeLookup(String edgeLabel, String indexPostfix, Object key) {
	OrientBaseGraph orientBaseGraph = unwrapCurrentGraph();
	List<Object> ids = new ArrayList<>();

	// Load the edge type in order to access the indices of the edge
	OrientEdgeType edgeType = orientBaseGraph.getEdgeType(edgeLabel);
	if (edgeType != null) {
		// Fetch the required index
		OIndex<?> index = edgeType.getClassIndex("e." + edgeLabel.toLowerCase() + "_" + indexPostfix);
		if (index != null) {
			// Iterate over the sb-tree index entries
			OIndexCursor cursor = index.iterateEntriesMajor(new OCompositeKey(key), true, false);
			while (cursor.hasNext()) {
				Entry<Object, OIdentifiable> entry = cursor.nextEntry();
				if (entry != null) {
					OCompositeKey entryKey = (OCompositeKey) entry.getKey();
					// The index returns all entries. We thus need to filter it manually
					if (entryKey.getKeys().get(1).equals(key)) {
						Object inId = entryKey.getKeys().get(0);
						// Only add the inbound vertex id to the list of ids
						ids.add(inId);
					}
				} else {
					break;
				}
			}
		}
	}
	return ids;
}
 
开发者ID:gentics,项目名称:mesh,代码行数:32,代码来源:OrientDBDatabase.java

示例3: ensureEdgeTypeExistence

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


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