コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public <EXCEPTION extends Exception> void relationshipVisit(long relationshipId, org.neo4j.storageengine.api.RelationshipVisitor<EXCEPTION> relationshipVisitor) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException, EXCEPTION
        public override void RelationshipVisit <EXCEPTION>(long relationshipId, RelationshipVisitor <EXCEPTION> relationshipVisitor) where EXCEPTION : Exception
        {
            // TODO Please don't create a record for this, it's ridiculous
            RelationshipRecord record = _relationshipStore.getRecord(relationshipId, _relationshipStore.newRecord(), CHECK);

            if (!record.InUse())
            {
                throw new EntityNotFoundException(EntityType.RELATIONSHIP, relationshipId);
            }
            relationshipVisitor.Visit(relationshipId, record.Type, record.FirstNode, record.SecondNode);
        }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private Command visitRelationshipCommand(org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException
        private Command VisitRelationshipCommand(ReadableChannel channel)
        {
            long id = channel.Long;

            RelationshipRecord before = ReadRelationshipRecord(id, channel);

            if (before == null)
            {
                return(null);
            }

            RelationshipRecord after = ReadRelationshipRecord(id, channel);

            if (after == null)
            {
                return(null);
            }

            if (!before.InUse() && after.InUse())
            {
                after.SetCreated();
            }
            return(new Command.RelationshipCommand(before, after));
        }