Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void createConstraint(String key, String property) throws org.neo4j.internal.kernel.api.exceptions.KernelException
            internal override void CreateConstraint(string key, string property)
            {
                TokenWrite tokenWrite    = TokenWriteInNewTransaction();
                int        relTypeId     = tokenWrite.RelationshipTypeGetOrCreateForName(key);
                int        propertyKeyId = tokenWrite.PropertyKeyGetOrCreateForName(property);

                Commit();

                SchemaWrite schemaWrite = SchemaWriteInNewTransaction();

                schemaWrite.RelationshipPropertyExistenceConstraintCreate(forRelType(relTypeId, propertyKeyId));
                Commit();
            }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void createConstraint(String key, String property) throws org.neo4j.internal.kernel.api.exceptions.KernelException
            internal override void CreateConstraint(string key, string property)
            {
                TokenWrite tokenWrite  = TokenWriteInNewTransaction();
                int        label       = tokenWrite.LabelGetOrCreateForName(key);
                int        propertyKey = tokenWrite.PropertyKeyGetOrCreateForName(property);

                Commit();

                SchemaWrite schemaWrite = SchemaWriteInNewTransaction();

                schemaWrite.NodeKeyConstraintCreate(forLabel(label, propertyKey));
                Commit();
            }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void createConstraint(String label, String propertyKey) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        private void CreateConstraint(string label, string propertyKey)
        {
            int        labelId;
            int        propertyKeyId;
            TokenWrite tokenWrite = TokenWriteInNewTransaction();

            labelId       = tokenWrite.LabelGetOrCreateForName(label);
            propertyKeyId = tokenWrite.PropertyKeyGetOrCreateForName(propertyKey);
            Commit();

            SchemaWrite schemaWrite = SchemaWriteInNewTransaction();

            schemaWrite.UniquePropertyConstraintCreate(forLabel(labelId, propertyKeyId));
            Commit();
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.internal.kernel.api.IndexReference createIndex(org.neo4j.internal.kernel.api.Transaction transaction) throws org.neo4j.internal.kernel.api.exceptions.schema.SchemaKernelException, org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException
        private IndexReference CreateIndex([email protected] transaction)
        {
            TokenWrite            tokenWrite       = transaction.TokenWrite();
            SchemaWrite           schemaWrite      = transaction.SchemaWrite();
            LabelSchemaDescriptor schemaDescriptor = forLabel(tokenWrite.LabelGetOrCreateForName("hello"), tokenWrite.PropertyKeyGetOrCreateForName("hepp"));

            return(schemaWrite.IndexCreate(schemaDescriptor));
        }