Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void createCompositeIndex(org.neo4j.graphdb.GraphDatabaseService graphDb, String label, String... properties) throws Exception
        protected internal override void CreateCompositeIndex(GraphDatabaseService graphDb, string label, params string[] properties)
        {
            GraphDatabaseAPI  @internal   = ( GraphDatabaseAPI )graphDb;
            KernelTransaction ktx         = @internal.DependencyResolver.resolveDependency(typeof(ThreadToStatementContextBridge)).getKernelTransactionBoundToThisThread(true);
            SchemaWrite       schemaWrite = ktx.SchemaWrite();
            TokenWrite        token       = ktx.TokenWrite();

            schemaWrite.IndexCreate(SchemaDescriptorFactory.forLabel(token.LabelGetOrCreateForName("Person"), token.PropertyKeyGetOrCreateForName("firstname"), token.PropertyKeyGetOrCreateForName("surname")));
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.neo4j.storageengine.api.schema.IndexDescriptor createAnIndex(HighlyAvailableGraphDatabase db, org.neo4j.graphdb.Label label, String propertyName) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        private static IndexDescriptor CreateAnIndex(HighlyAvailableGraphDatabase db, Label label, string propertyName)
        {
            using (Transaction tx = Db.beginTx())
            {
                KernelTransaction ktx        = KernelTransaction(db);
                int            labelId       = ktx.TokenWrite().labelGetOrCreateForName(label.Name());
                int            propertyKeyId = ktx.TokenWrite().propertyKeyGetOrCreateForName(propertyName);
                IndexReference index         = ktx.SchemaWrite().indexCreate(SchemaDescriptorFactory.forLabel(labelId, propertyKeyId));
                tx.Success();
                return(( IndexDescriptor )index);
            }
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.internal.kernel.api.schema.constraints.ConstraintDescriptor createUniqueConstraint(int labelId, int pkId) throws Exception
        private ConstraintDescriptor CreateUniqueConstraint(int labelId, int pkId)
        {
            KernelTransaction ktx = ktx();

            return(ktx.SchemaWrite().uniquePropertyConstraintCreate(SchemaDescriptorFactory.forLabel(labelId, pkId)));
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.internal.kernel.api.IndexReference createSchemaIndex(int labelId, int pkId) throws Exception
        private IndexReference CreateSchemaIndex(int labelId, int pkId)
        {
            KernelTransaction ktx = ktx();

            return(ktx.SchemaWrite().indexCreate(SchemaDescriptorFactory.forLabel(labelId, pkId)));
        }