Esempio n. 1
0
 private bool HasProperty(PropertyCursor propertyCursor, int property)
 {
     while (propertyCursor.Next())
     {
         if (propertyCursor.PropertyKey() == property)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 2
0
 internal CursorPropertyAccessor(NodeCursor nodeCursor, PropertyCursor propertyCursor, Read read)
 {
     this._nodeCursor     = nodeCursor;
     this._propertyCursor = propertyCursor;
     this._read           = read;
 }
 public override void Properties(PropertyCursor cursor)
 {
     (( DefaultPropertyCursor )cursor).InitRelationship(RelationshipReference(), PropertiesReference(), Read, Read);
 }
Esempio n. 4
0
 public override void Properties(PropertyCursor cursor)
 {
     (( DefaultPropertyCursor )cursor).InitNode(NodeReference(), PropertiesReference(), _read, _read);
 }
Esempio n. 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public abstract void validateRelationshipPropertyExistenceConstraint(org.neo4j.internal.kernel.api.RelationshipScanCursor relationshipCursor, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, org.neo4j.internal.kernel.api.schema.RelationTypeSchemaDescriptor descriptor) throws org.neo4j.internal.kernel.api.exceptions.schema.CreateConstraintFailureException;
        public abstract void ValidateRelationshipPropertyExistenceConstraint(RelationshipScanCursor relationshipCursor, PropertyCursor propertyCursor, RelationTypeSchemaDescriptor descriptor);
Esempio n. 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public abstract 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 abstract void ValidateNodePropertyExistenceConstraint(NodeLabelIndexCursor allNodes, NodeCursor nodeCursor, PropertyCursor propertyCursor, LabelSchemaDescriptor descriptor);
Esempio n. 7
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);
        }
Esempio n. 8
0
        /// <summary>
        /// Fetches a given property from a relationship
        /// </summary>
        /// <param name="read"> The current Read instance </param>
        /// <param name="relationship"> 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 relationshipGetProperty(org.neo4j.internal.kernel.api.Read read, org.neo4j.internal.kernel.api.RelationshipScanCursor relationship, long node, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, int prop) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException
        public static Value RelationshipGetProperty(Read read, RelationshipScanCursor relationship, long node, PropertyCursor propertyCursor, int prop)
        {
            if (prop == StatementConstants.NO_SUCH_PROPERTY_KEY)
            {
                return(Values.NO_VALUE);
            }
            SingleRelationship(read, relationship, node);
            relationship.Properties(propertyCursor);
            while (propertyCursor.Next())
            {
                if (propertyCursor.PropertyKey() == prop)
                {
                    return(propertyCursor.PropertyValue());
                }
            }

            return(Values.NO_VALUE);
        }
Esempio n. 9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void validateRelationshipPropertyExistenceConstraint(org.neo4j.internal.kernel.api.RelationshipScanCursor relationshipCursor, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, org.neo4j.internal.kernel.api.schema.RelationTypeSchemaDescriptor descriptor) throws org.neo4j.internal.kernel.api.exceptions.schema.CreateConstraintFailureException
        public override void ValidateRelationshipPropertyExistenceConstraint(RelationshipScanCursor relationshipCursor, PropertyCursor propertyCursor, RelationTypeSchemaDescriptor descriptor)
        {
            throw PropertyExistenceConstraintsNotAllowed(descriptor);
        }
Esempio n. 10
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)
        {
            throw PropertyExistenceConstraintsNotAllowed(descriptor);
        }
Esempio n. 11
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void validateNodeKeyConstraint(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 ValidateNodeKeyConstraint(NodeLabelIndexCursor allNodes, NodeCursor nodeCursor, PropertyCursor propertyCursor, LabelSchemaDescriptor descriptor)
        {
            ValidateNodePropertyExistenceConstraint(allNodes, nodeCursor, propertyCursor, descriptor);
        }
Esempio n. 12
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()));
                        }
                    }
                }
            }
        }
Esempio n. 13
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void validateRelationshipPropertyExistenceConstraint(org.neo4j.internal.kernel.api.RelationshipScanCursor relationshipCursor, org.neo4j.internal.kernel.api.PropertyCursor propertyCursor, org.neo4j.internal.kernel.api.schema.RelationTypeSchemaDescriptor descriptor) throws org.neo4j.internal.kernel.api.exceptions.schema.CreateConstraintFailureException
        public override void ValidateRelationshipPropertyExistenceConstraint(RelationshipScanCursor relationshipCursor, PropertyCursor propertyCursor, RelationTypeSchemaDescriptor descriptor)
        {
            while (relationshipCursor.Next())
            {
                relationshipCursor.Properties(propertyCursor);

                foreach (int propertyKey in descriptor.PropertyIds)
                {
                    if (relationshipCursor.Type() == descriptor.RelTypeId && !HasProperty(propertyCursor, propertyKey))
                    {
                        throw CreateConstraintFailure(new RelationshipPropertyExistenceException(descriptor, VERIFICATION, relationshipCursor.RelationshipReference()));
                    }
                }
            }
        }