Exemplo n.º 1
0
        /// <summary>
        /// Fetches a given property from a node
        /// </summary>
        /// <param name="read"> The current Read instance </param>
        /// <param name="nodeCursor"> The node cursor to use </param>
        /// <param name="node"> The id of the node </param>
        /// <param name="propertyCursor"> The property cursor to use </param>
        /// <param name="prop"> The id of the property to find </param>
        /// <returns> The value of the given property </returns>
        /// <exception cref="EntityNotFoundException"> If the node cannot be find. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static org.neo4j.values.storable.Value nodeGetProperty(org.neo4j.internal.kernel.api.Read read, org.neo4j.internal.kernel.api.NodeCursor nodeCursor, long node, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, int prop) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException
        public static Value NodeGetProperty(Read read, NodeCursor nodeCursor, long node, PropertyCursor propertyCursor, int prop)
        {
            if (prop == StatementConstants.NO_SUCH_PROPERTY_KEY)
            {
                return(Values.NO_VALUE);
            }
            SingleNode(read, nodeCursor, node);
            nodeCursor.Properties(propertyCursor);
            while (propertyCursor.Next())
            {
                if (propertyCursor.PropertyKey() == prop)
                {
                    return(propertyCursor.PropertyValue());
                }
            }

            return(Values.NO_VALUE);
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void validateNodePropertyExistenceConstraint(org.neo4j.internal.kernel.api.NodeLabelIndexCursor allNodes, org.neo4j.internal.kernel.api.NodeCursor nodeCursor, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, org.neo4j.internal.kernel.api.schema.LabelSchemaDescriptor descriptor) throws org.neo4j.internal.kernel.api.exceptions.schema.CreateConstraintFailureException
        public override void ValidateNodePropertyExistenceConstraint(NodeLabelIndexCursor allNodes, NodeCursor nodeCursor, PropertyCursor propertyCursor, LabelSchemaDescriptor descriptor)
        {
            while (allNodes.Next())
            {
                allNodes.Node(nodeCursor);
                while (nodeCursor.Next())
                {
                    foreach (int propertyKey in descriptor.PropertyIds)
                    {
                        nodeCursor.Properties(propertyCursor);
                        if (!HasProperty(propertyCursor, propertyKey))
                        {
                            throw CreateConstraintFailure(new NodePropertyExistenceException(descriptor, VERIFICATION, nodeCursor.NodeReference()));
                        }
                    }
                }
            }
        }