示例#1
0
 private static long GetLabelId(HighlyAvailableGraphDatabase db, Label label)
 {
     using (Transaction ignore = Db.beginTx())
     {
         ThreadToStatementContextBridge bridge = ThreadToStatementContextBridgeFrom(db);
         return(bridge.GetKernelTransactionBoundToThisThread(true).tokenRead().nodeLabel(label.Name()));
     }
 }
示例#2
0
        private int LabelId(Label alien)
        {
            ThreadToStatementContextBridge contextBridge = (( GraphDatabaseAPI )_db).DependencyResolver.resolveDependency(typeof(ThreadToStatementContextBridge));

            using (Transaction tx = _db.beginTx())
            {
                return(contextBridge.GetKernelTransactionBoundToThisThread(true).tokenRead().nodeLabel(alien.Name()));
            }
        }
示例#3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void lockNodeUsingUniqueIndexSeek(org.neo4j.kernel.internal.GraphDatabaseAPI database, org.neo4j.graphdb.Label label, String nameProperty) throws org.neo4j.internal.kernel.api.exceptions.KernelException
        private static void LockNodeUsingUniqueIndexSeek(GraphDatabaseAPI database, Label label, string nameProperty)
        {
            using (Transaction transaction = database.BeginTx())
            {
                ThreadToStatementContextBridge contextBridge = database.DependencyResolver.resolveDependency(typeof(ThreadToStatementContextBridge));
                KernelTransaction kernelTransaction          = contextBridge.GetKernelTransactionBoundToThisThread(true);
                TokenRead         tokenRead = kernelTransaction.TokenRead();
                Read dataRead = kernelTransaction.DataRead();

                int            labelId        = tokenRead.NodeLabel(label.Name());
                int            propertyId     = tokenRead.PropertyKey(nameProperty);
                IndexReference indexReference = kernelTransaction.SchemaRead().index(labelId, propertyId);
                dataRead.LockingNodeUniqueIndexSeek(indexReference, IndexQuery.ExactPredicate.exact(propertyId, "value"));
                transaction.Success();
            }
        }