Class OSQLSynchQuery<T>
java.lang.Object
com.orientechnologies.orient.core.command.OCommandRequestAbstract
com.orientechnologies.orient.core.query.OQueryAbstract<T>
com.orientechnologies.orient.core.sql.query.OSQLQuery<T>
com.orientechnologies.orient.core.sql.query.OSQLAsynchQuery<T>
com.orientechnologies.orient.core.sql.query.OSQLSynchQuery<T>
- Type Parameters:
T-
- All Implemented Interfaces:
OCommandRequest,OCommandRequestAsynch,OCommandRequestInternal,OCommandRequestText,OCommandResultListener,OQuery<T>,Iterable<T>
- Direct Known Subclasses:
OLiveQuery
public class OSQLSynchQuery<T>
extends OSQLAsynchQuery<T>
implements OCommandResultListener, Iterable<T>
SQL synchronous query. When executed the caller wait for the result.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
- See Also:
-
Field Summary
Fields inherited from class com.orientechnologies.orient.core.command.OCommandRequestAbstract
cacheableResult, context, fetchPlan, limit, parameters, progressListener, resultListener, timeoutMs, timeoutStrategy, useCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidend()Called at the end of processing.booleanbooleanSets default non idempotent to avoid custom query deadlocks database.iterator()protected voidqueryFromStream(OMemoryStream buffer, ORecordSerializer serializer) protected OMemoryStreamvoidreset()Resets the query removing the result set.voidbooleanThis method is called for each result.Delegates to the OQueryExecutor the query execution.Methods inherited from class com.orientechnologies.orient.core.sql.query.OSQLQuery
deserializeQueryParameters, fromStream, getText, runFirst, serializeQueryParameters, setText, toStream, toStringMethods inherited from class com.orientechnologies.orient.core.query.OQueryAbstract
execute, getFetchPlan, setFetchPlanMethods inherited from class com.orientechnologies.orient.core.command.OCommandRequestAbstract
addExcludedNode, convertToParameters, getContext, getLimit, getParameters, getProgressListener, getResultListener, getTimeoutStrategy, getTimeoutTime, isCacheableResult, isRecordResultSet, isUseCache, removeExcludedNode, setCacheableResult, setContext, setLimit, setParameters, setProgressListener, setRecordResultSet, setResultListener, setTimeout, setUseCacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.orientechnologies.orient.core.command.OCommandRequest
execute, getContext, getFetchPlan, getLimit, getTimeoutStrategy, getTimeoutTime, setContext, setFetchPlan, setLimit, setTimeout, setUseCacheMethods inherited from interface com.orientechnologies.orient.core.command.OCommandRequestAsynch
getResultListener, setResultListenerMethods inherited from interface com.orientechnologies.orient.core.command.OCommandRequestInternal
getParameters, getProgressListener, getResultListener, isCacheableResult, isRecordResultSet, setCacheableResult, setProgressListener, setRecordResultSet, setResultListener
-
Constructor Details
-
OSQLSynchQuery
public OSQLSynchQuery() -
OSQLSynchQuery
-
OSQLSynchQuery
-
-
Method Details
-
reset
public void reset()Description copied from class:OQueryAbstractResets the query removing the result set. Call this to reuse the Query object preventing a pagination.- Specified by:
resetin interfaceOCommandRequestInternal- Specified by:
resetin interfaceOQuery<T>- Overrides:
resetin classOQueryAbstract<T>
-
result
Description copied from interface:OCommandResultListenerThis method is called for each result.- Specified by:
resultin interfaceOCommandResultListener- Parameters:
iRecord- Current record- Returns:
- True to continue the query, otherwise false
-
end
public void end()Description copied from interface:OCommandResultListenerCalled at the end of processing. This is useful to clean-up local attributes.- Specified by:
endin interfaceOCommandResultListener
-
run
Description copied from class:OSQLQueryDelegates to the OQueryExecutor the query execution. -
isIdempotent
public boolean isIdempotent()Description copied from class:OSQLAsynchQuerySets default non idempotent to avoid custom query deadlocks database.- Specified by:
isIdempotentin interfaceOCommandRequest- Overrides:
isIdempotentin classOSQLAsynchQuery<T>
-
getResult
- Specified by:
getResultin interfaceOCommandResultListener
-
getNextPageRID
- Returns:
- RID of the record that will be processed first during pagination mode.
-
resetPagination
public void resetPagination() -
iterator
-
isAsynchronous
public boolean isAsynchronous()- Specified by:
isAsynchronousin interfaceOCommandRequestAsynch- Overrides:
isAsynchronousin classOSQLAsynchQuery<T>
-
queryToStream
- Overrides:
queryToStreamin classOSQLQuery<T>
-
queryFromStream
- Overrides:
queryFromStreamin classOSQLQuery<T>
-