public override void RemoveRelationship(long entityId, string key, object value, long startNode, long endNode) { AssertValidKey(key); RelationshipData entity = new RelationshipData(entityId, startNode, endNode); foreach (object oneValue in IoPrimitiveUtils.asArray(value)) { oneValue = GetCorrectValue(oneValue); Transaction.remove(this, entity, key, oneValue); AddRemoveCommand(entityId, key, oneValue); } }
/// <summary> /// See <seealso cref="Index.remove(PropertyContainer, string, object)"/> for more /// generic documentation. /// /// Removes key/value to the {@code entity} in this index. Removed values /// are excluded within the transaction, but composite {@code AND} /// queries aren't guaranteed to exclude removed values correctly within /// that transaction. When the transaction has been committed all such /// queries are guaranteed to return correct results. /// </summary> /// <param name="entityId"> the entity (i.e <seealso cref="Node"/> or <seealso cref="Relationship"/>) /// to dissociate the key/value pair from. </param> /// <param name="key"> the key in the key/value pair to dissociate from the entity. </param> /// <param name="value"> the value in the key/value pair to dissociate from the /// entity. </param> public override void Remove(long entityId, string key, object value) { AssertValidKey(key); EntityId entity = new IdData(entityId); foreach (object oneValue in IoPrimitiveUtils.asArray(value)) { oneValue = GetCorrectValue(oneValue); Transaction.remove(this, entity, key, oneValue); AddRemoveCommand(entityId, key, oneValue); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void addRelationship(long entityId, String key, Object value, long startNode, long endNode) throws org.neo4j.internal.kernel.api.exceptions.explicitindex.ExplicitIndexNotFoundKernelException public override void AddRelationship(long entityId, string key, object value, long startNode, long endNode) { AssertValidKey(key); AssertValidValue(value); RelationshipData entity = new RelationshipData(entityId, startNode, endNode); foreach (object oneValue in IoPrimitiveUtils.asArray(value)) { oneValue = GetCorrectValue(oneValue); DataSource.assertValidType(key, oneValue, IdentifierConflict); Transaction.add(this, entity, key, oneValue); CommandFactory.addRelationship(IdentifierConflict.indexName, entityId, key, oneValue, startNode, endNode); } }
private void AddSingleProperty(long entityId, Document document, string key, object value) { foreach (object oneValue in IoPrimitiveUtils.asArray(value)) { bool isValueContext = oneValue is ValueContext; oneValue = isValueContext ? (( ValueContext )oneValue).CorrectValue : oneValue.ToString(); _type.addToDocument(document, key, oneValue); if (_createdNow) { // If we know that the index was created this session // then we can go ahead and add stuff to the cache directly // when adding to the index. AddToCache(entityId, key, oneValue); } } }
internal PropertiesRep(PropertyContainer entity, long id) { this.EntityId = id; this.EntityToString = entity.ToString(); foreach (string key in entity.PropertyKeys) { Serializable value = ( Serializable )entity.GetProperty(key, null); // We do this because the node may have changed since we did getPropertyKeys() if (value != null) { if (value.GetType().IsArray) { Props[key] = new List <>(Arrays.asList(IoPrimitiveUtils.asArray(value))); } else { Props[key] = value; } } } }