Exemplo n.º 1
0
        public override void Delete()
        {
            KernelTransaction ktx = TxBridge.get();

            try
            {
                using (Statement ignore = ktx.AcquireStatement())
                {
                    Type.drop(ktx.IndexWrite(), NameConflict);
                }
            }
            catch (InvalidTransactionTypeKernelException e)
            {
                throw new ConstraintViolationException(e.Message, e);
            }
            catch (ExplicitIndexNotFoundKernelException)
            {
                throw new NotFoundException(Type + " index '" + NameConflict + "' doesn't exist");
            }
        }
Exemplo n.º 2
0
        public override void Remove(T entity, string key, object value)
        {
            KernelTransaction ktx = TxBridge.get();

            try
            {
                using (Statement ignore = ktx.AcquireStatement())
                {
                    Type.remove(ktx.IndexWrite(), NameConflict, Type.id(entity), key, value);
                }
            }
            catch (InvalidTransactionTypeKernelException e)
            {
                throw new ConstraintViolationException(e.Message, e);
            }
            catch (ExplicitIndexNotFoundKernelException)
            {
                throw new NotFoundException(Type + " index '" + NameConflict + "' doesn't exist");
            }
        }
Exemplo n.º 3
0
        public override RelationshipIndex GetOrCreateRelationshipIndex(string indexName, IDictionary <string, string> customConfiguration)
        {
            KernelTransaction ktx = _transactionBridge.get();

            try
            {
                using (Statement ignore = ktx.AcquireStatement())
                {
                    if (!ktx.IndexRead().relationshipExplicitIndexExists(indexName, customConfiguration))
                    {
                        // There's a sub-o-meta thing here where we create index config,
                        // and the index will itself share the same IndexConfigStore as us and pick up and use
                        // that. We should pass along config somehow with calls.
                        ktx.IndexWrite().relationshipExplicitIndexCreateLazily(indexName, customConfiguration);
                    }
                    return(new RelationshipExplicitIndexProxy(indexName, _gds, _transactionBridge));
                }
            }
            catch (InvalidTransactionTypeKernelException e)
            {
                throw new ConstraintViolationException(e.Message, e);
            }
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void internalAdd(T entity, String key, Object value, org.neo4j.kernel.api.KernelTransaction transaction) throws org.neo4j.internal.kernel.api.exceptions.EntityNotFoundException, org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException, org.neo4j.internal.kernel.api.exceptions.explicitindex.ExplicitIndexNotFoundKernelException
        private void InternalAdd(T entity, string key, object value, KernelTransaction transaction)
        {
            Type.add(transaction.IndexWrite(), NameConflict, Type.id(entity), key, value);
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void internalRemove(org.neo4j.kernel.api.KernelTransaction ktx, long id) throws org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException, org.neo4j.internal.kernel.api.exceptions.explicitindex.ExplicitIndexNotFoundKernelException
        private void InternalRemove(KernelTransaction ktx, long id)
        {
            Type.remove(ktx.IndexWrite(), NameConflict, id);
        }