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


Java OType.STRING属性代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.metadata.schema.OType.STRING属性的典型用法代码示例。如果您正苦于以下问题:Java OType.STRING属性的具体用法?Java OType.STRING怎么用?Java OType.STRING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.orientechnologies.orient.core.metadata.schema.OType的用法示例。


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

示例1: convertType

/**
 * Convert the vendor agnostic type to an orientdb specific type.
 * 
 * @param fieldType
 * @return
 */
private OType convertType(FieldType fieldType) {
	switch (fieldType) {
	case STRING:
		return OType.STRING;
	case INTEGER:
		return OType.INTEGER;
	case BOOLEAN:
		return OType.BOOLEAN;
	case STRING_SET:
		return OType.EMBEDDEDSET;
	case STRING_LIST:
		return OType.EMBEDDEDLIST;
	default:
		throw new RuntimeException("Unsupported type {" + fieldType + "}");
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:22,代码来源:OrientDBDatabase.java

示例2: addCustomEdgeIndex

@Override
public void addCustomEdgeIndex(String label, String indexPostfix, String... fields) {
	OrientGraphNoTx noTx = factory.getNoTx();
	try {
		OrientEdgeType e = noTx.getEdgeType(label);
		if (e == null) {
			throw new RuntimeException("Could not find edge type {" + label + "}. Create edge type before creating indices.");
		}

		for (String key : fields) {
			if (e.getProperty(key) == null) {
				OType type = OType.STRING;
				if (key.equals("out") || key.equals("in")) {
					type = OType.LINK;
				}
				e.createProperty(key, type);
			}
		}
		String name = "e." + label + "_" + indexPostfix;
		name = name.toLowerCase();
		if (fields.length != 0 && e.getClassIndex(name) == null) {
			e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, fields);
		}

	} finally {
		noTx.shutdown();
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:28,代码来源:OrientDBDatabase.java

示例3: convertToSubType

/**
 * Convert the vendor agnostic type to an orientdb specific sub type (eg. string for string lists)
 * 
 * @param fieldType
 * @return
 */
private OType convertToSubType(FieldType fieldType) {
	switch (fieldType) {
	case STRING_SET:
		return OType.STRING;
	case STRING_LIST:
		return OType.STRING;
	default:
		return null;
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:16,代码来源:OrientDBDatabase.java

示例4: createIndex

/**
 * Creates the SBTree index paired to this field within this logical index.
 */
protected void createIndex(final Class<?> keyClass) {
	final OIndexManager indexManager = getIndexManager();

	// Indexes have to be created outside transactions
	final String idxName = getSBTreeIndexName(keyClass);
	final boolean txWasOpen = graph.getGraph().getTransaction().isActive();
	if (txWasOpen) {
		graph.getConsole().println("Warning: prematurely committing a transaction so we can create index " + idxName);
		graph.saveDirty();
		graph.getGraph().commit();
	}

	// Index key type
	OType keyType = OType.STRING;
	if (keyClass == Byte.class || keyClass == Short.class || keyClass == Integer.class || keyClass == Long.class) {
		keyType = OType.INTEGER;
	} else if (keyClass == Float.class || keyClass == Double.class) {
		keyType = OType.DOUBLE;
	}

	// Create SBTree NOTUNIQUE index
    final OIndexFactory factory = OIndexes.getFactory(OClass.INDEX_TYPE.NOTUNIQUE.toString(), null);
	
	final OSimpleKeyIndexDefinition indexDef = new OSimpleKeyIndexDefinition(factory.getLastVersion(), OType.STRING, keyType);
	indexManager.createIndex(idxName, OClass.INDEX_TYPE.NOTUNIQUE.toString(), indexDef, null, null, null, null);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:29,代码来源:AbstractOrientIndex.java

示例5: getSBTreeIndexName

protected String getSBTreeIndexName(final Class<?> keyClass) {
	OType keyType = OType.STRING;
	if (keyClass == Byte.class || keyClass == Short.class || keyClass == Integer.class || keyClass == Long.class) {
		keyType = OType.INTEGER;
	} else if (keyClass == Float.class || keyClass == Double.class) {
		keyType = OType.DOUBLE;
	}

	return escapedName + SEPARATOR_SBTREE + keyType.name();
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:10,代码来源:AbstractOrientIndex.java


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