Package com.buschmais.cdo.neo4j.impl.datastore.metadata

Examples of com.buschmais.cdo.neo4j.impl.datastore.metadata.PropertyMetadata


            reCreateIndex(label, propertyMethodMetadata);
        }
    }

    private void reCreateIndex(Label label, PrimitivePropertyMethodMetadata propertyMethodMetadata) {
        PropertyMetadata propertyMetadata = ((PrimitivePropertyMethodMetadata<PropertyMetadata>) propertyMethodMetadata).getDatastoreMetadata();
        IndexDefinition index = findIndex(label, propertyMetadata.getName());
        //TODO propertyMethodMetadata is always != null
        if (propertyMethodMetadata != null && index == null) {
            LOGGER.info("Creating index for label {} on property '{}'.", label, propertyMetadata.getName());
            graphDatabaseService.schema().indexFor(label).on(propertyMetadata.getName()).create();
        } else if (propertyMethodMetadata == null && index != null) {
            LOGGER.info("Dropping index for label {} on properties '{}'.", label, index.getPropertyKeys());
            index.drop();
        }
    }
View Full Code Here


        }
    }


    private void reCreateUniqueConstraint(Label label, PrimitivePropertyMethodMetadata propertyMethodMetadata) {
        PropertyMetadata propertyMetadata = ((PrimitivePropertyMethodMetadata<PropertyMetadata>) propertyMethodMetadata).getDatastoreMetadata();
        ConstraintDefinition constraint = findUniqueConstraint(label, propertyMetadata.getName());
        //TODO propertyMethodMetadata is always != null
        if (propertyMethodMetadata != null && constraint == null) {
            LOGGER.info("Creating constraint for label {} on property '{}'.", label, propertyMetadata.getName());
            graphDatabaseService.schema().constraintFor(label).assertPropertyIsUnique(propertyMetadata.getName()).create();
        } else if (propertyMethodMetadata == null && constraint != null) {
            LOGGER.info("Dropping constraint for label {} on properties '{}'.", label, constraint.getPropertyKeys());
            constraint.drop();
        }
    }
View Full Code Here

TOP

Related Classes of com.buschmais.cdo.neo4j.impl.datastore.metadata.PropertyMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.