本文整理汇总了Java中com.orientechnologies.orient.core.metadata.schema.OClass.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java OClass.getProperty方法的具体用法?Java OClass.getProperty怎么用?Java OClass.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orientechnologies.orient.core.metadata.schema.OClass
的用法示例。
在下文中一共展示了OClass.getProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUpgradeSchema_TypeDoesNotYetExist
import com.orientechnologies.orient.core.metadata.schema.OClass; //导入方法依赖的package包/类
@Test
public void testUpgradeSchema_TypeDoesNotYetExist() throws Exception {
service.upgradeSchema();
try (ODatabaseDocumentTx db = database.getInstance().connect()) {
OSchema schema = db.getMetadata().getSchema();
OClass type = schema.getClass("key_store");
assertThat(type, is(notNullValue()));
OProperty prop = type.getProperty("name");
assertThat(prop, is(notNullValue()));
assertThat(prop.isMandatory(), is(true));
assertThat(prop.isNotNull(), is(true));
assertThat(prop.getType(), is(OType.STRING));
prop = type.getProperty("bytes");
assertThat(prop, is(notNullValue()));
assertThat(prop.isMandatory(), is(true));
assertThat(prop.isNotNull(), is(true));
assertThat(prop.getType(), is(OType.BINARY));
assertThat(type.getInvolvedIndexes("name"), hasSize(1));
assertThat(type.getInvolvedIndexes("name").iterator().next().getType(), is("UNIQUE"));
}
}
示例2: modifyCaseInsensitiveNameField
import com.orientechnologies.orient.core.metadata.schema.OClass; //导入方法依赖的package包/类
private void modifyCaseInsensitiveNameField(final OClass type) {
log.info("Modifying case-insensitive name field on component");
OProperty ciNameProperty = type.getProperty(P_CI_NAME);
if (!ciNameProperty.isMandatory()) {
ciNameProperty.setMandatory(true);
}
if (!ciNameProperty.isNotNull()) {
ciNameProperty.setNotNull(true);
}
}