本文整理汇总了Java中com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata类的典型用法代码示例。如果您正苦于以下问题:Java IndexedPropertyMethodMetadata类的具体用法?Java IndexedPropertyMethodMetadata怎么用?Java IndexedPropertyMethodMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IndexedPropertyMethodMetadata类属于com.buschmais.xo.spi.metadata.method包,在下文中一共展示了IndexedPropertyMethodMetadata类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEntityMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
@Override
public DuctileVertexMetadata createEntityMetadata(AnnotatedType annotatedType,
Map<Class<?>, TypeMetadata> metadataByType) {
VertexDefinition annotation = annotatedType.getAnnotation(VertexDefinition.class);
String value = null;
IndexedPropertyMethodMetadata<?> indexedProperty = null;
if (annotation != null) {
value = annotation.value();
if ((value == null) || (value.isEmpty())) {
value = annotatedType.getName();
}
Class<?> usingIndexOf = annotation.usingIndexedPropertyOf();
if (!Object.class.equals(usingIndexOf)) {
TypeMetadata typeMetadata = metadataByType.get(usingIndexOf);
indexedProperty = typeMetadata.getIndexedProperty();
}
}
return new DuctileVertexMetadata(value, indexedProperty);
}
示例2: checkAndInitializePropertyIndizes
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
private void checkAndInitializePropertyIndizes(Map<Class<?>, TypeMetadata> registeredMetadata) {
for (TypeMetadata metadata : registeredMetadata.values()) {
IndexedPropertyMethodMetadata<?> indexedProperty = metadata.getIndexedProperty();
if (indexedProperty != null) {
DuctileIndexedPropertyMetadata datastoreMetadata = (DuctileIndexedPropertyMetadata) indexedProperty
.getDatastoreMetadata();
String name = datastoreMetadata.getName();
Class<? extends Serializable> dataType = datastoreMetadata.getDataType();
Class<? extends Element> type = datastoreMetadata.getType();
boolean unique = datastoreMetadata.isUnique();
logger.info("Indexed property '" + name + "' was found (unique=" + unique
+ "). Check for presence of index...");
ElementType elementType;
if (DuctileVertex.class.isAssignableFrom(type)) {
elementType = ElementType.VERTEX;
} else if (DuctileEdge.class.isAssignableFrom(type)) {
elementType = ElementType.EDGE;
} else {
throw new XOException("Unsupported element type '" + type.getName() + "' found.");
}
checkAndCreatePropertyIndex(name, dataType, elementType, unique);
}
}
}
示例3: checkAndInitializePropertyIndizes
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
private void checkAndInitializePropertyIndizes(
Map<Class<?>, TypeMetadata> registeredMetadata) {
for (TypeMetadata metadata : registeredMetadata.values()) {
IndexedPropertyMethodMetadata<?> indexedProperty = metadata
.getIndexedProperty();
if (indexedProperty != null) {
TitanIndexedPropertyMetadata datastoreMetadata = (TitanIndexedPropertyMetadata) indexedProperty
.getDatastoreMetadata();
String name = datastoreMetadata.getName();
Class<?> dataType = datastoreMetadata.getDataType();
Class<? extends Element> type = datastoreMetadata.getType();
boolean unique = datastoreMetadata.isUnique();
logger.info("Indexed property '" + name
+ "' was found. Check for presence of index...");
checkAndCreatePropertyIndex(name, dataType, type, unique);
}
}
}
示例4: createEntityMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
@Override
public TitanVertexMetadata createEntityMetadata(
AnnotatedType annotatedType,
Map<Class<?>, TypeMetadata> metadataByType) {
VertexDefinition annotation = annotatedType
.getAnnotation(VertexDefinition.class);
String value = null;
IndexedPropertyMethodMetadata<?> indexedProperty = null;
if (annotation != null) {
value = annotation.value();
if ((value == null) || (value.isEmpty())) {
value = annotatedType.getName();
}
Class<?> usingIndexOf = annotation.usingIndexedPropertyOf();
if (!Object.class.equals(usingIndexOf)) {
TypeMetadata typeMetadata = metadataByType.get(usingIndexOf);
indexedProperty = typeMetadata.getIndexedProperty();
}
}
return new TitanVertexMetadata(value, indexedProperty);
}
示例5: createEntityMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
@Override
public NodeMetadata createEntityMetadata(AnnotatedType annotatedType, List<TypeMetadata> superTypes, Map<Class<?>, TypeMetadata> metadataByType) {
Label labelAnnotation = annotatedType.getAnnotation(Label.class);
L label = null;
IndexedPropertyMethodMetadata<IndexedPropertyMetadata> indexedProperty = null;
if (labelAnnotation != null) {
String value = labelAnnotation.value();
if (Label.DEFAULT_VALUE.equals(value)) {
value = annotatedType.getName();
}
label = createLabel(value);
Class<?> usingIndexOf = labelAnnotation.usingIndexedPropertyOf();
if (!Object.class.equals(usingIndexOf)) {
TypeMetadata typeMetadata = metadataByType.get(usingIndexOf);
indexedProperty = typeMetadata.getIndexedProperty();
}
}
boolean batchable = isBatchable(annotatedType);
return new NodeMetadata<L>(label, indexedProperty, batchable);
}
示例6: getIndexedPropertyMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public static <L extends Neo4jLabel> PropertyMetadata getIndexedPropertyMetadata(EntityTypeMetadata<NodeMetadata<L>> type,
PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata) {
if (propertyMethodMetadata == null) {
IndexedPropertyMethodMetadata<?> indexedProperty = type.getDatastoreMetadata().getUsingIndexedPropertyOf();
if (indexedProperty == null) {
throw new XOException("Type " + type.getAnnotatedType().getAnnotatedElement().getName() + " has no indexed property.");
}
propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
}
return propertyMethodMetadata.getDatastoreMetadata();
}
示例7: ensureIndex
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
/**
* Ensures that an index exists for the given entity and property.
*
* @param entityTypeMetadata
* The entity.
* @param indexedProperty
* The index metadata.
*/
private void ensureIndex(DS session, EntityTypeMetadata<NodeMetadata<L>> entityTypeMetadata,
IndexedPropertyMethodMetadata<IndexedPropertyMetadata> indexedProperty) {
if (indexedProperty != null) {
IndexedPropertyMetadata datastoreMetadata = indexedProperty.getDatastoreMetadata();
if (datastoreMetadata.isCreate()) {
L label = entityTypeMetadata.getDatastoreMetadata().getDiscriminator();
PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata = indexedProperty.getPropertyMethodMetadata();
if (label != null && propertyMethodMetadata != null) {
ensureIndex(session, label, propertyMethodMetadata, datastoreMetadata.isUnique());
}
}
}
}
示例8: AbstractTypeMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
protected AbstractTypeMetadata(AnnotatedType annotatedType, Collection<TypeMetadata> superTypes, Collection<MethodMetadata<?, ?>> properties,
IndexedPropertyMethodMetadata indexedProperty) {
this.annotatedType = annotatedType;
this.superTypes = superTypes;
this.properties = properties;
this.indexedProperty = indexedProperty;
}
示例9: find
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
@Override
public <T> ResultIterable<T> find(final Class<T> type, final Object value) {
sessionContext.getCacheSynchronizationService().flush();
EntityTypeMetadata<EntityMetadata> entityTypeMetadata = sessionContext.getMetadataProvider().getEntityMetadata(type);
IndexedPropertyMethodMetadata indexedProperty = entityTypeMetadata.getIndexedProperty();
Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity = new HashMap<>(1);
if (indexedProperty != null) {
exampleEntity.put(indexedProperty.getPropertyMethodMetadata(), value);
} else {
exampleEntity.put(null, value);
}
return findByExample(type, exampleEntity);
}
示例10: DuctileVertexMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public DuctileVertexMetadata(String discriminator,
IndexedPropertyMethodMetadata<?> indexedProperty) {
super();
this.discriminator = discriminator;
this.indexedProperty = indexedProperty;
}
示例11: getIndexedProperty
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public IndexedPropertyMethodMetadata<?> getIndexedProperty() {
return indexedProperty;
}
示例12: TitanVertexMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public TitanVertexMetadata(String discriminator,
IndexedPropertyMethodMetadata<?> indexedProperty) {
super();
this.discriminator = discriminator;
this.indexedProperty = indexedProperty;
}
示例13: NodeMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public NodeMetadata(L label, IndexedPropertyMethodMetadata<IndexedPropertyMetadata> usingIndexedPropertyOf, boolean batchable) {
super(batchable);
this.label = label;
this.usingIndexedPropertyOf = usingIndexedPropertyOf;
}
示例14: getUsingIndexedPropertyOf
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
public IndexedPropertyMethodMetadata<IndexedPropertyMetadata> getUsingIndexedPropertyOf() {
return usingIndexedPropertyOf;
}
示例15: AbstractDatastoreTypeMetadata
import com.buschmais.xo.spi.metadata.method.IndexedPropertyMethodMetadata; //导入依赖的package包/类
protected AbstractDatastoreTypeMetadata(AnnotatedType annotatedType, Collection<TypeMetadata> superTypes, Collection<MethodMetadata<?, ?>> properties, IndexedPropertyMethodMetadata indexedProperty, DatastoreMetadata datastoreMetadata) {
super(annotatedType, superTypes, properties, indexedProperty);
this.datastoreMetadata = datastoreMetadata;
}