public class NativeQuery extends Object implements MutationAction, RawAndTypeMapDefaultImpl
| Constructor and Description |
|---|
NativeQuery(AbstractEntityProperty<?> meta,
RuntimeEngine rte,
BoundStatement boundStatement,
Object[] encodedBoundValues) |
| Modifier and Type | Method and Description |
|---|---|
BoundStatement |
boundStatement() |
Object[] |
encodedBoundValues() |
CompletableFuture<ExecutionInfo> |
executeAsyncWithStats()
Execute the native query asynchronously and return the execution info
|
AbstractEntityProperty<?> |
meta() |
CassandraOptions |
options() |
RuntimeEngine |
runtimeEngine() |
NativeQuery |
withDMLResultsDisplaySize(int DMLResultsDisplaySize)
When DEBUG log is enabled, restrict the Results Display to maximum DMLResultsDisplaySize rows.
|
NativeQuery |
withLwtResultListener(info.archinnov.achilles.type.lightweighttransaction.LWTResultListener lwtResultListener)
Add a single LWT result listeners.
|
NativeQuery |
withLwtResultListeners(List<info.archinnov.achilles.type.lightweighttransaction.LWTResultListener> lwtResultListeners)
Add a list of LWT result listeners.
|
NativeQuery |
withResultSetAsyncListener(java.util.function.Function<ResultSet,ResultSet> resultSetAsyncListener)
Add the given async listener on the
ResultSet object. |
NativeQuery |
withResultSetAsyncListeners(List<java.util.function.Function<ResultSet,ResultSet>> resultSetAsyncListeners)
Add the given list of async listeners on the
ResultSet object. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, executeAsync, executeWithStatsgetTypedMapAsyncWithStats, getTypedMapsAsyncWithStats, typedMapIterator, typedMapIteratorWithExecutionInfogetTypedMap, getTypedMapAsync, getTypedMaps, getTypedMapsAsync, getTypedMapsWithStats, getTypedMapWithStats, mapResultSetToTypedMaps, mapRowToTypedMapextractCauseFromExecutionExceptiongetOperationTypepublic NativeQuery(AbstractEntityProperty<?> meta, RuntimeEngine rte, BoundStatement boundStatement, Object[] encodedBoundValues)
public NativeQuery withLwtResultListeners(List<info.archinnov.achilles.type.lightweighttransaction.LWTResultListener> lwtResultListeners)
LWTResultListener lwtListener = new LWTResultListener() {
public void onError(LWTResult lwtResult) {
//Get type of LWT operation that fails
LWTResult.Operation operation = lwtResult.operation();
// Print out current values
TypedMap currentValues = lwtResult.currentValues();
currentValues
.entrySet()
.forEach(entry -> System.out.println(String.format("%s = %s",entry.getKey(), entry.getValue())));
}
};
public NativeQuery withLwtResultListener(info.archinnov.achilles.type.lightweighttransaction.LWTResultListener lwtResultListener)
LWTResultListener lwtListener = new LWTResultListener() {
public void onError(LWTResult lwtResult) {
//Get type of LWT operation that fails
LWTResult.Operation operation = lwtResult.operation();
// Print out current values
TypedMap currentValues = lwtResult.currentValues();
currentValues
.entrySet()
.forEach(entry -> System.out.println(String.format("%s = %s",entry.getKey(), entry.getValue())));
}
};
public NativeQuery withResultSetAsyncListeners(List<java.util.function.Function<ResultSet,ResultSet>> resultSetAsyncListeners)
ResultSet object.
Example of usage:
.withResultSetAsyncListeners(Arrays.asList(resultSet -> {
//Do something with the resultSet object here
}))
Remark: it is not allowed to consume the ResultSet values. It is strongly advised to read only meta datapublic NativeQuery withResultSetAsyncListener(java.util.function.Function<ResultSet,ResultSet> resultSetAsyncListener)
ResultSet object.
Example of usage:
.withResultSetAsyncListener(resultSet -> {
//Do something with the resultSet object here
})
Remark: it is not allowed to consume the ResultSet values. It is strongly advised to read only meta datapublic NativeQuery withDMLResultsDisplaySize(int DMLResultsDisplaySize)
DMLResultsDisplaySize - the maximum number of returned rows to be displayedpublic CompletableFuture<ExecutionInfo> executeAsyncWithStats()
executeAsyncWithStats in interface MutationActionpublic RuntimeEngine runtimeEngine()
runtimeEngine in interface RawAndTypeMapDefaultImplpublic AbstractEntityProperty<?> meta()
meta in interface RawAndTypeMapDefaultImplpublic BoundStatement boundStatement()
boundStatement in interface RawAndTypeMapDefaultImplpublic Object[] encodedBoundValues()
encodedBoundValues in interface RawAndTypeMapDefaultImplpublic CassandraOptions options()
options in interface RawAndTypeMapDefaultImplCopyright © 2012-2021. All Rights Reserved.