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
@Internal public class BasicStoredQuery<E,R> extends java.lang.Object implements StoredQuery<E,R>
The basic implementation ofStoredQuery.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
-
Constructor Summary
Constructors Constructor Description BasicStoredQuery(java.lang.String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String query, java.lang.String[] expandableQueryParts, java.util.List<QueryParameterBinding> queryParameterBindings, java.lang.Class<E> rootEntity, java.lang.Class<R> resultType, boolean pageable, boolean isSingleResult, boolean isCount)BasicStoredQuery(java.lang.String query, java.lang.String[] expandableQueryParts, java.util.List<QueryParameterBinding> queryParameterBindings, java.lang.Class<E> rootEntity, java.lang.Class<R> resultType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micronaut.core.annotation.AnnotationMetadatagetAnnotationMetadata()java.lang.String[]getExpandableQueryParts()The query to execute.java.lang.StringgetName()java.lang.StringgetQuery()The query to execute.java.util.List<QueryParameterBinding>getQueryBindings()The list of query bindings.io.micronaut.core.type.Argument<R>getResultArgument()The query result type.DataTypegetResultDataType()java.lang.Class<R>getResultType()The query result type.java.lang.Class<E>getRootEntity()The root entity type.booleanhasPageable()Does the query have a pageable.booleanhasResultConsumer()booleanisCount()booleanisSingleResult()Whether the query can be treated as a single result.booleanuseNumericPlaceholders()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, 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.StoredDataOperation
getTransactionDefinition
-
Methods inherited from interface io.micronaut.data.model.runtime.StoredQuery
getArgumentTypes, getEntityIdentifierType, getIndexedParameterAutoPopulatedPreviousPropertyIndexes, getIndexedParameterAutoPopulatedPreviousPropertyPaths, getIndexedParameterAutoPopulatedPropertyPaths, getIndexedParameterBinding, getIndexedParameterPaths, getIndexedParameterTypes, getJoinFetchPaths, getLastUpdatedProperty, getParameterBinding, getParameterNames, getQueryHints, hasInExpression, isDtoProjection, isNative, isOptimisticLock
-
-
-
-
Constructor Detail
-
BasicStoredQuery
public BasicStoredQuery(java.lang.String query, java.lang.String[] expandableQueryParts, java.util.List<QueryParameterBinding> queryParameterBindings, java.lang.Class<E> rootEntity, java.lang.Class<R> resultType)
-
BasicStoredQuery
public BasicStoredQuery(java.lang.String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.String query, java.lang.String[] expandableQueryParts, java.util.List<QueryParameterBinding> queryParameterBindings, java.lang.Class<E> rootEntity, java.lang.Class<R> resultType, boolean pageable, boolean isSingleResult, boolean isCount)
-
-
Method Detail
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getRootEntity
public java.lang.Class<E> getRootEntity()
Description copied from interface:StoredQueryThe root entity type.- Specified by:
getRootEntityin interfaceStoredQuery<E,R>- Returns:
- The root entity type
-
getResultType
public java.lang.Class<R> getResultType()
Description copied from interface:StoredQueryThe query result type. This may differ from the root entity type returned byStoredQuery.getRootEntity().- Specified by:
getResultTypein interfaceStoredQuery<E,R>- Returns:
- The query result type
-
getResultArgument
public io.micronaut.core.type.Argument<R> getResultArgument()
Description copied from interface:StoredQueryThe query result type. This may differ from the root entity type returned byStoredQuery.getRootEntity().- Specified by:
getResultArgumentin interfaceStoredDataOperation<E>- Specified by:
getResultArgumentin interfaceStoredQuery<E,R>- Returns:
- The query result type
-
getResultDataType
public DataType getResultDataType()
- Specified by:
getResultDataTypein interfaceStoredQuery<E,R>- Returns:
- The result data type.
-
hasPageable
public boolean hasPageable()
Description copied from interface:StoredQueryDoes the query have a pageable.- Specified by:
hasPageablein interfaceStoredQuery<E,R>- Returns:
- True if it does
-
getQuery
public java.lang.String getQuery()
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getQueryin interfaceStoredQuery<E,R>- Returns:
- The query to execute
-
getExpandableQueryParts
public java.lang.String[] getExpandableQueryParts()
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getExpandableQueryPartsin interfaceStoredQuery<E,R>- Returns:
- The query to execute
-
getQueryBindings
public java.util.List<QueryParameterBinding> getQueryBindings()
Description copied from interface:StoredQueryThe list of query bindings.- Specified by:
getQueryBindingsin interfaceStoredQuery<E,R>- Returns:
- the query bindings
-
useNumericPlaceholders
public boolean useNumericPlaceholders()
Description copied from interface:StoredQueryAre the placeholders for query set using numeric indices starting from 1.- Specified by:
useNumericPlaceholdersin interfaceStoredQuery<E,R>- Returns:
- True if they are.
-
isCount
public boolean isCount()
- Specified by:
isCountin interfaceStoredQuery<E,R>- Returns:
- Is this a count query.
-
isSingleResult
public boolean isSingleResult()
Description copied from interface:StoredQueryWhether the query can be treated as a single result.- Specified by:
isSingleResultin interfaceStoredQuery<E,R>- Returns:
- True if it can.
-
hasResultConsumer
public boolean hasResultConsumer()
- Specified by:
hasResultConsumerin interfaceStoredQuery<E,R>- Returns:
- Whether a result consumer is present
-
-