//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldMakeEntryConflicts() public virtual void ShouldMakeEntryConflicts() { LabelSchemaDescriptor schema = SchemaDescriptorFactory.forLabel(LABEL_ID, 2); IndexEntryConflictException e = new IndexEntryConflictException(0L, 1L, Value); assertThat(e.EvidenceMessage(SchemaUtil.idTokenNameLookup, schema), equalTo("Both Node(0) and Node(1) have the label `label[1]` and property `property[2]` = 'hi'")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldMakeEntryConflictsForOneNode() public virtual void ShouldMakeEntryConflictsForOneNode() { LabelSchemaDescriptor schema = SchemaDescriptorFactory.forLabel(LABEL_ID, 2); IndexEntryConflictException e = new IndexEntryConflictException(0L, StatementConstants.NO_SUCH_NODE, Value); assertThat(e.EvidenceMessage(SchemaUtil.idTokenNameLookup, schema), equalTo("Node(0) already exists with label `label[1]` and property `property[2]` = 'hi'")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldMakeCompositeEntryConflicts() public virtual void ShouldMakeCompositeEntryConflicts() { LabelSchemaDescriptor schema = SchemaDescriptorFactory.forLabel(LABEL_ID, 2, 3, 4); ValueTuple values = ValueTuple.of(true, "hi", new long[] { 6L, 4L }); IndexEntryConflictException e = new IndexEntryConflictException(0L, 1L, values); assertThat(e.EvidenceMessage(SchemaUtil.idTokenNameLookup, schema), equalTo("Both Node(0) and Node(1) have the label `label[1]` " + "and properties `property[2]` = true, `property[3]` = 'hi', `property[4]` = [6, 4]")); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private org.neo4j.internal.kernel.api.IndexReference createIndex(org.neo4j.internal.kernel.api.Transaction transaction) throws org.neo4j.internal.kernel.api.exceptions.schema.SchemaKernelException, org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException private IndexReference CreateIndex([email protected] transaction) { TokenWrite tokenWrite = transaction.TokenWrite(); SchemaWrite schemaWrite = transaction.SchemaWrite(); LabelSchemaDescriptor schemaDescriptor = forLabel(tokenWrite.LabelGetOrCreateForName("hello"), tokenWrite.PropertyKeyGetOrCreateForName("hepp")); return(schemaWrite.IndexCreate(schemaDescriptor)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotBePossibleToCreateConstraintWithDuplicateProperties() throws org.neo4j.internal.kernel.api.exceptions.KernelException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldNotBePossibleToCreateConstraintWithDuplicateProperties() { // given SchemaWrite schemaWrite = SchemaWriteInNewTransaction(); // when try { LabelSchemaDescriptor descriptor = forLabel(0, 1, 1); schemaWrite.UniquePropertyConstraintCreate(descriptor); fail("Should have failed"); } catch (RepeatedPropertyInSchemaException) { // then good } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: void shouldCreateWithSpecificExistingProviderName(IndexCreator creator) throws org.neo4j.internal.kernel.api.exceptions.KernelException internal virtual void ShouldCreateWithSpecificExistingProviderName(IndexCreator creator) { int labelId = 0; foreach (GraphDatabaseSettings.SchemaIndex indexSetting in GraphDatabaseSettings.SchemaIndex.values()) { // given SchemaWrite schemaWrite = SchemaWriteInNewTransaction(); string provider = indexSetting.providerName(); LabelSchemaDescriptor descriptor = forLabel(labelId++, 0); creator.Create(schemaWrite, descriptor, provider); // when Commit(); // then assertEquals(provider, IndexingService.getIndexProxy(descriptor).Descriptor.providerDescriptor().name()); } }
internal IndexBackedConstraintDescriptor(Org.Neo4j.@internal.Kernel.Api.schema.constraints.ConstraintDescriptor_Type type, LabelSchemaDescriptor schema) : base(type) { this._schema = schema; }
internal NodeKeyConstraintDescriptor(LabelSchemaDescriptor schema) : base(org.neo4j.@internal.kernel.api.schema.constraints.ConstraintDescriptor_Type.UniqueExists, schema) { }
internal NodeExistenceConstraintDescriptor(LabelSchemaDescriptor schema) : base(org.neo4j.@internal.kernel.api.schema.constraints.ConstraintDescriptor_Type.Exists) { this._schema = schema; }
//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);
internal UniquenessConstraintDescriptor(LabelSchemaDescriptor schema) : base(org.neo4j.@internal.kernel.api.schema.constraints.ConstraintDescriptor_Type.Unique, schema) { }
//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); }
public NodePropertyExistenceException(LabelSchemaDescriptor schema, ConstraintValidationException.Phase phase, long nodeId) : base(ConstraintDescriptorFactory.existsForSchema(schema), phase, format("Node(%d)", nodeId)) { this._schema = schema; this._nodeId = nodeId; }
public void processSpecific([email protected] schema) { _callHistory.Add("LabelSchemaDescriptor"); }
//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); }
//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())); } } } } }