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 StoredQuery
StoredQuery.OperationType -
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionBasicStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, String query, String[] expandableQueryParts, List<QueryParameterBinding> queryParameterBindings, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, boolean isDto, boolean embeddedProjection, boolean optionalEmbeddedProjection, StoredQuery.OperationType operationType) 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 isCount, boolean isDto, StoredQuery.OperationType operationType) 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 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.AnnotationMetadataString[]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.booleanDoes the query have a pageable.booleanbooleanisCount()booleanReturns whether the query returns the actual entity or a Data Transfer Object (DTO) project.booleanReturns whether the query result is a nullable embedded property of the root entity.booleanGets an indicator telling whether underlying query is raw query.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredMethods inherited from interface StoredQuery
getJoinPaths, getOutParameterBindings, getParameterExpressions, getQueryHints, getQueryLimit, getSort, 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 isCount, 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 isCount, boolean isDto, 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 isCount, boolean isDto, boolean embeddedProjection, boolean optionalEmbeddedProjection, StoredQuery.OperationType operationType) - Parameters:
name- The nameannotationMetadata- The annotation metadataquery- The queryexpandableQueryParts- The expandable query partsqueryParameterBindings- The parameter bindingsrootEntity- The root entityresultType- The result typepageable- Whether the query is pageableisCount- Whether the query is a count queryisDto- Whether the query is a DTO projectionembeddedProjection- Whether the query projects an embedded propertyoptionalEmbeddedProjection- Whether the projected embedded property is optionaloperationType- The operation type- Since:
- 5.2.0
-
-
Method Details
-
isDtoProjection
public boolean isDtoProjection()Description copied from interface:StoredQueryReturns whether the query returns the actual entity or a Data Transfer Object (DTO) project. Defaults to false.- Specified by:
isDtoProjectionin interfaceStoredQuery<E,R> - Returns:
- Whether the query is a DTO projection query
-
isOptionalEmbeddedProjection
public boolean isOptionalEmbeddedProjection()Description copied from interface:StoredQueryReturns whether the query result is a nullable embedded property of the root entity. Such a result is absent when none of the embedded values is set. Defaults to false.- Specified by:
isOptionalEmbeddedProjectionin interfaceStoredQuery<E,R> - Returns:
- Whether the query result is an optional embedded property
-
getOperationType
Description copied from interface:StoredQueryGet the operation type.- Specified by:
getOperationTypein interfaceStoredQuery<E,R> - Returns:
- The operation type.
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getName
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getRootEntity
Description copied from interface:StoredQueryThe root entity type.- Specified by:
getRootEntityin interfaceStoredQuery<E,R> - Returns:
- The root entity type
-
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
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
- 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
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getQueryin interfaceStoredQuery<E,R> - Returns:
- The query to execute
-
getExpandableQueryParts
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getExpandableQueryPartsin interfaceStoredQuery<E,R> - Returns:
- The query to execute
-
getQueryBindings
Description copied from interface:StoredQueryThe list of query bindings.- Specified by:
getQueryBindingsin interfaceStoredQuery<E,R> - Returns:
- the query bindings
-
isCount
public boolean isCount()- Specified by:
isCountin interfaceStoredQuery<E,R> - Returns:
- Is this a count query.
-
hasResultConsumer
public boolean hasResultConsumer()- Specified by:
hasResultConsumerin interfaceStoredQuery<E,R> - Returns:
- Whether a result consumer is present
-
isRawQuery
public boolean isRawQuery()Description copied from interface:StoredQueryGets an indicator telling whether underlying query is raw query.- Specified by:
isRawQueryin interfaceStoredQuery<E,R> - Returns:
- true if it is raw query
-