assertSame(node.entity(), indexedNode); assertTrue( node.wasCreated() ); verify( index ).get( "key1", "value1" ); verify( index ).putIfAbsent( indexedNode, "key1", "value1" );
return new UniqueEntity<>( result, wasCreated );
UniqueEntity<Relationship> entity = factory.getOrCreateWithOutcome( key, value ); created = entity.entity().getId() == relationship.getId() || entity.wasCreated(); result = entity.entity(); new UniqueRelationshipFactory( indexName, node( startNode ), node( endNode ), type, properties ); UniqueEntity<Relationship> entity = factory.getOrCreateWithOutcome( key, value ); result = entity.entity(); created = entity.wasCreated();
UniqueEntity<Node> entity = factory.getOrCreateWithOutcome( key, value ); created = entity.entity().getId() == node.getId() || entity.wasCreated(); result = entity.entity(); result = entity.entity(); created = entity.wasCreated();
return new UniqueEntity<>( result, wasCreated );
/** * Get the indexed entity, creating it (exactly once) if no indexed entity exists. * @param key the key to find the entity under in the index. * @param value the value the key is mapped to for the entity in the index. * @return the unique entity in the index. */ @Deprecated public final T getOrCreate( String key, Object value ) { return getOrCreateWithOutcome( key, value ).entity(); }
UniqueEntity<Relationship> entity = factory.getOrCreateWithOutcome( key, value ); created = entity.entity().getId() == relationship.getId() || entity.wasCreated(); result = entity.entity(); new UniqueRelationshipFactory( indexName, node( startNode ), node( endNode ), type, properties ); UniqueEntity<Relationship> entity = factory.getOrCreateWithOutcome( key, value ); result = entity.entity(); created = entity.wasCreated();
UniqueEntity<Node> entity = factory.getOrCreateWithOutcome( key, value ); created = entity.entity().getId() == node.getId() || entity.wasCreated(); result = entity.entity(); result = entity.entity(); created = entity.wasCreated();
assertSame(node.entity(), concurrentNode); assertFalse( node.wasCreated() ); verify( index ).get( "key1", "value1" ); verify( index ).putIfAbsent( createdNode, "key1", "value1" );
/** * Get the indexed entity, creating it (exactly once) if no indexed entity exists. * @param key the key to find the entity under in the index. * @param value the value the key is mapped to for the entity in the index. * @return the unique entity in the index. */ @Deprecated public final T getOrCreate( String key, Object value ) { return getOrCreateWithOutcome( key, value ).entity(); }