//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddRelationshipToExplicitIndex() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAddRelationshipToExplicitIndex()
        {
            long relId;

            using (Org.Neo4j.Graphdb.Transaction ctx = graphDb.beginTx())
            {
                relId = graphDb.createNode().createRelationshipTo(graphDb.createNode(), RelationshipType.withName("R")).Id;
                ctx.Success();
            }

            using (Transaction tx = beginTransaction())
            {
                ExplicitIndexWrite indexWrite = tx.IndexWrite();
                indexWrite.RelationshipAddToExplicitIndex(INDEX_NAME, relId, KEY, VALUE);
                tx.Success();
            }

            // Then
            using (Org.Neo4j.Graphdb.Transaction ctx = graphDb.beginTx())
            {
                IndexHits <Relationship> hits = graphDb.index().forRelationships(INDEX_NAME).get(KEY, VALUE);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertThat(hits.next().Id, equalTo(relId));
                hits.Close();
                ctx.Success();
            }
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void add(org.neo4j.internal.kernel.api.ExplicitIndexWrite operations, String name, long id, String key, Object value) throws org.neo4j.internal.kernel.api.exceptions.explicitindex.ExplicitIndexNotFoundKernelException, org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException
            public void add(ExplicitIndexWrite operations, string name, long id, string key, object value)
            {
                operations.RelationshipAddToExplicitIndex(name, id, key, value);
            }