Ejemplo n.º 1
0
        public virtual IEnumerable <ConstraintDefinition> getConstraints(RelationshipType type)
        {
            KernelTransaction transaction = SafeAcquireTransaction(_transactionSupplier);

            using (Statement ignore = transaction.AcquireStatement())
            {
                TokenRead  tokenRead  = transaction.TokenRead();
                SchemaRead schemaRead = transaction.SchemaRead();
                int        typeId     = tokenRead.RelationshipType(type.Name());
                if (typeId == [email protected]_Fields.NO_TOKEN)
                {
                    return(emptyList());
                }
                return(AsConstraintDefinitions(schemaRead.ConstraintsGetForRelationshipType(typeId), tokenRead));
            }
        }