Пример #1
0
        private bool RelationshipExistsByQuery(RelationshipIndex index, Node startNode, Node endNode, bool specifyStartNode)
        {
            bool found = false;

            using (Transaction tx = Db.beginTx(), IndexHits <Relationship> query = index.Query("key", QueryContext.numericRange("key", 0, 3), specifyStartNode ? startNode : null, null))
            {
                foreach (Relationship relationship in query)
                {
                    if (relationship.StartNodeId == startNode.Id && relationship.EndNodeId == endNode.Id)
                    {
                        found = true;
                        break;
                    }
                }

                tx.Success();
            }
            return(found);
        }
Пример #2
0
 public override IndexHits <Relationship> Query(string key, object queryOrQueryObjectOrNull, Node startNodeOrNull, Node endNodeOrNull)
 {
     return(@delegate.Query(key, queryOrQueryObjectOrNull, startNodeOrNull, endNodeOrNull));
 }