Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnIndexRuleForLabelAndVeryManyPropertiesComposite()
        public virtual void ShouldReturnIndexRuleForLabelAndVeryManyPropertiesComposite()
        {
            string[] props = "abcdefghijklmnopqrstuvwxyzABCDEFGHJILKMNOPQRSTUVWXYZ".Split("\\B", true);
            CreateSchema(Db =>
            {
                IndexCreator indexCreator = Db.schema().indexFor(Label.label(LABEL1));
                foreach (string prop in props)
                {
                    indexCreator = indexCreator.on(prop);
                }
                indexCreator.create();
            });

            StoreIndexDescriptor rule = _storage.indexGetForSchema(TestIndexDescriptorFactory.forLabel(LabelId(LABEL1), java.util.props.Select(this.propId).ToArray()));

            assertNotNull(rule);
            assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(LABEL1)));
            foreach (string prop in props)
            {
                assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(prop)));
            }
            assertEquals(IndexDescriptor.Type.GENERAL, rule.Type());
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnIndexRuleForLabelAndPropertyComposite()
        public virtual void ShouldReturnIndexRuleForLabelAndPropertyComposite()
        {
            string a = "a";
            string b = "b";
            string c = "c";
            string d = "d";
            string e = "e";
            string f = "f";

            CreateSchema(Db => Db.schema().indexFor(Label.label(LABEL1)).on(a).on(b).on(c).on(d).on(e).on(f).create());

            StoreIndexDescriptor rule = _storage.indexGetForSchema(TestIndexDescriptorFactory.forLabel(LabelId(LABEL1), PropId(a), PropId(b), PropId(c), PropId(d), PropId(e), PropId(f)));

            assertNotNull(rule);
            assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(LABEL1)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(a)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(b)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(c)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(d)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(e)));
            assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(f)));
            assertEquals(IndexDescriptor.Type.GENERAL, rule.Type());
        }
Example #3
0
 private void AssertRule(ConstraintRule rule, string label, string propertyKey, Org.Neo4j.@internal.Kernel.Api.schema.constraints.ConstraintDescriptor_Type type)
 {
     assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(label)));
     assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(propertyKey)));
     assertEquals(type, rule.ConstraintDescriptor.type());
 }
Example #4
0
 private void AssertRule(StoreIndexDescriptor rule, string label, string propertyKey, IndexDescriptor.Type type)
 {
     assertTrue(SchemaDescriptorPredicates.hasLabel(rule, LabelId(label)));
     assertTrue(SchemaDescriptorPredicates.hasProperty(rule, PropId(propertyKey)));
     assertEquals(type, rule.Type());
 }
Example #5
0
 public virtual IEnumerator <ConstraintRule> ConstraintsGetForLabel(int labelId)
 {
     return(LoadAllSchemaRules(rule => SchemaDescriptorPredicates.hasLabel(rule, labelId), typeof(ConstraintRule), false));
 }
Example #6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public java.util.Iterator<org.neo4j.internal.kernel.api.schema.constraints.ConstraintDescriptor> constraintsForRelationshipType(final int relTypeId)
        public virtual IEnumerator <ConstraintDescriptor> ConstraintsForRelationshipType(int relTypeId)
        {
            return(Iterators.filter(SchemaDescriptorPredicates.hasRelType(relTypeId), Constraints()));
        }
Example #7
0
 public virtual IEnumerator <ConstraintRule> ConstraintsGetForRelType(int relTypeId)
 {
     return(LoadAllSchemaRules(rule => SchemaDescriptorPredicates.hasRelType(rule, relTypeId), typeof(ConstraintRule), false));
 }
Example #8
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public java.util.Iterator<org.neo4j.internal.kernel.api.schema.constraints.ConstraintDescriptor> constraintsForLabel(final int label)
        public virtual IEnumerator <ConstraintDescriptor> ConstraintsForLabel(int label)
        {
            return(Iterators.filter(SchemaDescriptorPredicates.hasLabel(label), Constraints()));
        }
Example #9
0
 public override DiffSets <ConstraintDescriptor> ConstraintsChangesForRelationshipType(int relTypeId)
 {
     return(ConstraintsChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasRelType(relTypeId)));
 }
Example #10
0
 public override DiffSets <ConstraintDescriptor> ConstraintsChangesForLabel(int labelId)
 {
     return(ConstraintsChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasLabel(labelId)));
 }
Example #11
0
 public override DiffSets <IndexDescriptor> IndexDiffSetsByRelationshipType(int relationshipType)
 {
     return(IndexChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasRelType(relationshipType)));
 }
Example #12
0
 public override DiffSets <IndexDescriptor> IndexDiffSetsByLabel(int labelId)
 {
     return(IndexChangesDiffSets().filterAdded(SchemaDescriptorPredicates.hasLabel(labelId)));
 }