Package org.neo4j.graphdb.schema

Examples of org.neo4j.graphdb.schema.ConstraintDefinition


    }


    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


        }
    }

    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

    }


    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 org.neo4j.graphdb.schema.ConstraintDefinition

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.