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.AnnotationMetadata
getAnnotationMetadata()
java.lang.String[]
getExpandableQueryParts()
The query to execute.java.lang.String
getName()
java.lang.String
getQuery()
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.DataType
getResultDataType()
java.lang.Class<R>
getResultType()
The query result type.java.lang.Class<E>
getRootEntity()
The root entity type.boolean
hasPageable()
Does the query have a pageable.boolean
hasResultConsumer()
boolean
isCount()
boolean
isSingleResult()
Whether the query can be treated as a single result.boolean
useNumericPlaceholders()
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:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
-
getRootEntity
public java.lang.Class<E> getRootEntity()
Description copied from interface:StoredQuery
The root entity type.- Specified by:
getRootEntity
in interfaceStoredQuery<E,R>
- Returns:
- The root entity type
-
getResultType
public java.lang.Class<R> 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
public io.micronaut.core.type.Argument<R> 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
public DataType 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
public java.lang.String getQuery()
Description copied from interface:StoredQuery
The query to execute.- Specified by:
getQuery
in interfaceStoredQuery<E,R>
- Returns:
- The query to execute
-
getExpandableQueryParts
public java.lang.String[] getExpandableQueryParts()
Description copied from interface:StoredQuery
The query to execute.- Specified by:
getExpandableQueryParts
in interfaceStoredQuery<E,R>
- Returns:
- The query to execute
-
getQueryBindings
public java.util.List<QueryParameterBinding> 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
-
-