Search in sources :

Example 1 with RelExistenceConstraintDescriptor

use of org.neo4j.kernel.api.schema_new.constaints.RelExistenceConstraintDescriptor in project neo4j by neo4j.

the class DataIntegrityValidatingStatementOperations method relationshipPropertyExistenceConstraintCreate.

@Override
public RelExistenceConstraintDescriptor relationshipPropertyExistenceConstraintCreate(KernelStatement state, RelationTypeSchemaDescriptor descriptor) throws AlreadyConstrainedException, CreateConstraintFailureException, RepeatedPropertyInCompositeSchemaException {
    assertValidDescriptor(descriptor, OperationContext.CONSTRAINT_CREATION);
    ConstraintDescriptor constraint = ConstraintDescriptorFactory.existsForSchema(descriptor);
    assertConstraintDoesNotExist(state, constraint);
    return schemaWriteDelegate.relationshipPropertyExistenceConstraintCreate(state, descriptor);
}
Also used : UniquenessConstraintDescriptor(org.neo4j.kernel.api.schema_new.constaints.UniquenessConstraintDescriptor) NodeExistenceConstraintDescriptor(org.neo4j.kernel.api.schema_new.constaints.NodeExistenceConstraintDescriptor) ConstraintDescriptor(org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptor) RelExistenceConstraintDescriptor(org.neo4j.kernel.api.schema_new.constaints.RelExistenceConstraintDescriptor)

Example 2 with RelExistenceConstraintDescriptor

use of org.neo4j.kernel.api.schema_new.constaints.RelExistenceConstraintDescriptor in project neo4j by neo4j.

the class StateHandlingStatementOperations method relationshipPropertyExistenceConstraintCreate.

@Override
public RelExistenceConstraintDescriptor relationshipPropertyExistenceConstraintCreate(KernelStatement state, RelationTypeSchemaDescriptor descriptor) throws AlreadyConstrainedException, CreateConstraintFailureException {
    RelExistenceConstraintDescriptor constraint = ConstraintDescriptorFactory.existsForSchema(descriptor);
    state.txState().constraintDoAdd(constraint);
    return constraint;
}
Also used : RelExistenceConstraintDescriptor(org.neo4j.kernel.api.schema_new.constaints.RelExistenceConstraintDescriptor)

Aggregations

RelExistenceConstraintDescriptor (org.neo4j.kernel.api.schema_new.constaints.RelExistenceConstraintDescriptor)2 ConstraintDescriptor (org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptor)1 NodeExistenceConstraintDescriptor (org.neo4j.kernel.api.schema_new.constaints.NodeExistenceConstraintDescriptor)1 UniquenessConstraintDescriptor (org.neo4j.kernel.api.schema_new.constaints.UniquenessConstraintDescriptor)1