本文整理汇总了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();
}
}
示例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() );
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例7: call
import org.neo4j.graphdb.index.RelationshipIndex; //导入方法依赖的package包/类
@Override
public void call( RelationshipIndex self )
{
self.remove( null, "foo", 42 );
}