StringBuilder query = new StringBuilder( "MATCH" );
appendNodePattern( entityKey, parameters, query, ENTITY );
query.append( " - " );
query.append( relationshipCypher( associationKey, rowKey, parameters, entityKey.getColumnNames().length ) );
query.append( " - () RETURN r" );
ExecutionResult result = engine.execute( query.toString(), parameters );
ResourceIterator<Relationship> column = result.columnAs( "r" );
Relationship relationship = null;
if ( column.hasNext() ) {
relationship = column.next();
}
column.close();