Class BasicStoredQuery<E,R>
java.lang.Object
io.micronaut.data.runtime.query.internal.BasicStoredQuery<E,R>
- Type Parameters:
E
- The entity typeR
- The result type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,StoredDataOperation<R>
,StoredQuery<E,
R>
- Direct Known Subclasses:
QueryResultStoredQuery
The basic implementation of
StoredQuery
.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.model.runtime.StoredQuery
StoredQuery.OperationType
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Constructor Summary
ConstructorDescriptionBasicStoredQuery
(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, String query, String[] expandableQueryParts, List<QueryParameterBinding> queryParameterBindings, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isSingleResult, boolean isCount, StoredQuery.OperationType operationType) BasicStoredQuery
(String query, String[] expandableQueryParts, List<QueryParameterBinding> queryParameterBindings, Class<E> rootEntity, Class<R> resultType, StoredQuery.OperationType operationType) -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.annotation.AnnotationMetadata
String[]
The query to execute.getName()
Get the operation type.getQuery()
The query to execute.The list of query bindings.io.micronaut.core.type.Argument<R>
The query result type.The query result type.The root entity type.boolean
Does the query have a pageable.boolean
boolean
isCount()
boolean
Gets an indicator telling whether underlying query is raw query.boolean
Whether the query can be treated as a single result.boolean
Are the placeholders for query set using numeric indices starting from 1.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
Methods inherited from interface io.micronaut.data.model.runtime.StoredQuery
getArgumentTypes, getEntityIdentifierType, getJoinFetchPaths, getJoinPaths, getParameterExpressions, getQueryHints, isDtoProjection, isJsonEntity, isNative, isOptimisticLock, isProcedure
-
Constructor Details
-
BasicStoredQuery
public BasicStoredQuery(String query, String[] expandableQueryParts, List<QueryParameterBinding> queryParameterBindings, Class<E> rootEntity, Class<R> resultType, StoredQuery.OperationType operationType) -
BasicStoredQuery
public BasicStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, String query, String[] expandableQueryParts, List<QueryParameterBinding> queryParameterBindings, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isSingleResult, boolean isCount, StoredQuery.OperationType operationType)
-
-
Method Details
-
getOperationType
Description copied from interface:StoredQuery
Get the operation type.- Specified by:
getOperationType
in interfaceStoredQuery<E,
R> - Returns:
- The operation type.
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getName
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
getRootEntity
Description copied from interface:StoredQuery
The root entity type.- Specified by:
getRootEntity
in interfaceStoredQuery<E,
R> - Returns:
- The root entity type
-
getResultType
Description copied from interface:StoredQuery
The query result type. This may differ from the root entity type returned byStoredQuery.getRootEntity()
.- Specified by:
getResultType
in interfaceStoredQuery<E,
R> - Returns:
- The query result type
-
getResultArgument
Description copied from interface:StoredQuery
The query result type. This may differ from the root entity type returned byStoredQuery.getRootEntity()
.- Specified by:
getResultArgument
in interfaceStoredDataOperation<E>
- Specified by:
getResultArgument
in interfaceStoredQuery<E,
R> - Returns:
- The query result type
-
getResultDataType
- Specified by:
getResultDataType
in interfaceStoredQuery<E,
R> - Returns:
- The result data type.
-
hasPageable
public boolean hasPageable()Description copied from interface:StoredQuery
Does the query have a pageable.- Specified by:
hasPageable
in interfaceStoredQuery<E,
R> - Returns:
- True if it does
-
getQuery
Description copied from interface:StoredQuery
The query to execute.- Specified by:
getQuery
in interfaceStoredQuery<E,
R> - Returns:
- The query to execute
-
getExpandableQueryParts
Description copied from interface:StoredQuery
The query to execute.- Specified by:
getExpandableQueryParts
in interfaceStoredQuery<E,
R> - Returns:
- The query to execute
-
getQueryBindings
Description copied from interface:StoredQuery
The list of query bindings.- Specified by:
getQueryBindings
in interfaceStoredQuery<E,
R> - Returns:
- the query bindings
-
useNumericPlaceholders
public boolean useNumericPlaceholders()Description copied from interface:StoredQuery
Are the placeholders for query set using numeric indices starting from 1.- Specified by:
useNumericPlaceholders
in interfaceStoredQuery<E,
R> - Returns:
- True if they are.
-
isCount
public boolean isCount()- Specified by:
isCount
in interfaceStoredQuery<E,
R> - Returns:
- Is this a count query.
-
isSingleResult
public boolean isSingleResult()Description copied from interface:StoredQuery
Whether the query can be treated as a single result.- Specified by:
isSingleResult
in interfaceStoredQuery<E,
R> - Returns:
- True if it can.
-
hasResultConsumer
public boolean hasResultConsumer()- Specified by:
hasResultConsumer
in interfaceStoredQuery<E,
R> - Returns:
- Whether a result consumer is present
-
isRawQuery
public boolean isRawQuery()Description copied from interface:StoredQuery
Gets an indicator telling whether underlying query is raw query.- Specified by:
isRawQuery
in interfaceStoredQuery<E,
R> - Returns:
- true if it is raw query
-