Class ReusableTupleQueryResult

java.lang.Object
org.eclipse.rdf4j.spring.resultcache.ReusableTupleQueryResult
All Implemented Interfaces:
AutoCloseable, Iterable<BindingSet>, Iterator<BindingSet>, CloseableIteration<BindingSet>, QueryResult<BindingSet>, TupleQueryResult, ThrowableRecorder

public class ReusableTupleQueryResult extends Object implements TupleQueryResult, ThrowableRecorder
Wrapper for a TupleQueryResult, allowing the result to be replayed. The wrapper copies the result data, consuming the original result fully on close().

Example:

 TupleQueryResult result = tupleQuery.execute();
 ReuseableTupleQueryResult reusable = new ReuseableTupleQueryResult(result);
 while (reusable.hasNext()) {
        reuseable.next();
 }
 reuseable.close();
 TupleQueryResult cached = reuseable.recreateTupleQueryResult();
 while (cached.hasNext()) {
        cached.next();
 }
 cached.close();

 
Since:
4.0.0
Author:
Florian Kleedorfer