当前位置: 首页>>代码示例>>Java>>正文


Java RelationshipIndex.remove方法代码示例

本文整理汇总了Java中org.neo4j.graphdb.index.RelationshipIndex.remove方法的典型用法代码示例。如果您正苦于以下问题:Java RelationshipIndex.remove方法的具体用法?Java RelationshipIndex.remove怎么用?Java RelationshipIndex.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.neo4j.graphdb.index.RelationshipIndex的用法示例。


在下文中一共展示了RelationshipIndex.remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeSureYouCanRemoveFromRelationshipIndex

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Test
public void makeSureYouCanRemoveFromRelationshipIndex()
{
    Node n1 = graphDb.createNode();
    Node n2 = graphDb.createNode();
    Relationship r = n1.createRelationshipTo( n2, DynamicRelationshipType.withName( "foo" ) );
    RelationshipIndex index = graphDb.index().forRelationships( "rel-index" );
    String key = "bar";
    index.remove( r, key, "value" );
    index.add( r, key, "otherValue" );
    for ( int i = 0; i < 2; i++ )
    {
        assertThat( index.get( key, "value" ), isEmpty() );
        assertThat( index.get( key, "otherValue" ), contains( r ) );
        restartTx();
    }
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:18,代码来源:TestLuceneIndex.java

示例2: shouldNotSeeDeletedRelationshipWhenQueryingWithStartAndEndNode

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Test
public void shouldNotSeeDeletedRelationshipWhenQueryingWithStartAndEndNode()
{
    // GIVEN
    RelationshipIndex index = relationshipIndex( EXACT_CONFIG );
    Node start = graphDb.createNode();
    Node end = graphDb.createNode();
    RelationshipType type = withName( "REL" );
    Relationship rel = start.createRelationshipTo( end, type );
    index.add( rel, "Type", type.name() );
    finishTx( true );
    beginTx();

    // WHEN
    IndexHits<Relationship> hits = index.get( "Type", type.name(), start, end );
    assertEquals( 1, count( (Iterator<Relationship>)hits ) );
    assertEquals( 1, hits.size() );
    index.remove( rel );

    // THEN
    hits = index.get( "Type", type.name(), start, end );
    assertEquals( 0, count( (Iterator<Relationship>)hits ) );
    assertEquals( 0, hits.size() );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:25,代码来源:TestLuceneIndex.java

示例3: removeRelationshipFromIndex

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void removeRelationshipFromIndex(String name, long relationshipId, ParcelableError err) throws RemoteException {

    try {
        checkCallerHasWritePermission();
        resumeTrx();

        try {
            Relationship rel = mDb.getRelationshipById(relationshipId);
            RelationshipIndex index = mDb.index().forRelationships(name); // this
                                                                          // will
                                                                          // create
                                                                          // the
                                                                          // index
            index.remove(rel);
        } finally {
            suspendCurrentTrx("removeRelationshipFromIndex");
        }
    } catch (Exception e) {
        Log.e(TAG, "Failed to add relationship to index '" + name + "'", e);
        err.setError(Errors.TRANSACTION, e.getMessage());
    }

}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:25,代码来源:DbWrapper.java

示例4: removeRelationshipKeyFromIndex

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void removeRelationshipKeyFromIndex(String name, long relationshipId, String key, ParcelableError err)
        throws RemoteException {

    try {
        checkCallerHasWritePermission();
        resumeTrx();

        try {
            Relationship rel = mDb.getRelationshipById(relationshipId);
            RelationshipIndex index = mDb.index().forRelationships(name); // this
                                                                          // will
                                                                          // create
                                                                          // the
                                                                          // index
            index.remove(rel, key);
        } finally {
            suspendCurrentTrx("removeRelationshipKeyFromIndex");
        }
    } catch (Exception e) {
        Log.e(TAG, "Failed to add relationship to index '" + name + "'", e);
        err.setError(Errors.TRANSACTION, e.getMessage());
    }

}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:26,代码来源:DbWrapper.java

示例5: removeRelationshipKeyValueFromIndex

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void removeRelationshipKeyValueFromIndex(String name, long relationshipId, String key, ParcelableIndexValue value,
        ParcelableError err) throws RemoteException {

    try {
        checkCallerHasWritePermission();
        resumeTrx();

        try {
            Relationship rel = mDb.getRelationshipById(relationshipId);
            RelationshipIndex index = mDb.index().forRelationships(name); // this
                                                                          // will
                                                                          // create
                                                                          // the
                                                                          // index
            index.remove(rel, key, value.get());
        } finally {
            suspendCurrentTrx("removeRelationshipKeyValueFromIndex");
        }
    } catch (Exception e) {
        Log.e(TAG, "Failed to add relationship to index '" + name + "'", e);
        err.setError(Errors.TRANSACTION, e.getMessage());
    }

}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:26,代码来源:DbWrapper.java

示例6: updateRelationshipInIndex

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void updateRelationshipInIndex(String name, long relationshipId, String key, ParcelableIndexValue value,
        ParcelableError err) throws RemoteException {

    try {
        checkCallerHasWritePermission();
        resumeTrx();

        try {
            Relationship rel = mDb.getRelationshipById(relationshipId);
            RelationshipIndex index = mDb.index().forRelationships(name); // this
                                                                          // will
                                                                          // create
                                                                          // the
                                                                          // index

            // See http://docs.neo4j.org/chunked/stable/indexing-update.html
            index.remove(rel, key, value.get());
            index.add(rel, key, value.get());
        } finally {
            suspendCurrentTrx("updateRelationshipInIndex");
        }
    } catch (Exception e) {
        Log.e(TAG, "Failed to update relationship in index '" + name + "'", e);
        err.setError(Errors.TRANSACTION, e.getMessage());
    }
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:28,代码来源:DbWrapper.java

示例7: call

import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void call( RelationshipIndex self )
{
    self.remove( null, "foo", 42 );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:6,代码来源:RelationshipIndexFacadeMethods.java


注:本文中的org.neo4j.graphdb.index.RelationshipIndex.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。