Package io.micronaut.data.model.runtime
Interface StoredQuery<E,R>
- Type Parameters:
E
- The entity typeR
- The result type
- All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,StoredDataOperation<R>
- All Known Subinterfaces:
BindableParametersPreparedQuery<E,
,R> BindableParametersStoredQuery<E,
,R> DelegatePreparedQuery<E,
,R> DelegateStoredQuery<E,
,R> MongoPreparedQuery<E,
,R> MongoStoredQuery<E,
,R> PreparedQuery<E,
,R> SqlPreparedQuery<E,
,R> SqlStoredQuery<E,
R>
- All Known Implementing Classes:
BasicStoredQuery
,DefaultBindableParametersPreparedQuery
,DefaultBindableParametersStoredQuery
,DefaultPreparedQuery
,DefaultSqlPreparedQuery
,DefaultSqlStoredQuery
,DefaultStoredQuery
,DummyPreparedQuery
,QueryResultStoredQuery
A stored computed query. This interface represents the
- Since:
- 1.0.0
- Author:
- graemerocher
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Describes the operation type. -
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull Class<?>[]
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreDeprecated, for removal: This API element is subject to removal in a future version.Not used anymore@NonNull String[]
The query to execute.Deprecated, for removal: This API element is subject to removal in a future version.UsegetJoinPaths()
and filter the pathsGet the operation type.Parameter expressions.@NonNull String
getQuery()
The query to execute.The list of query bindings.The parameter binding.@NonNull io.micronaut.core.type.Argument<R>
The query result type.@NonNull DataType
The query result type.The root entity type.boolean
Does the query have a pageable.boolean
boolean
isCount()
default boolean
Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project.default boolean
default boolean
isNative()
In cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).default boolean
Is with an optimistic lock.default boolean
Is the query a procedure.boolean
Gets an indicator telling whether underlying query is raw query.boolean
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreboolean
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, 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.core.naming.Named
getName
-
Method Details
-
getRootEntity
The root entity type.- Returns:
- The root entity type
-
hasPageable
boolean hasPageable()Does the query have a pageable.- Returns:
- True if it does
-
getQuery
The query to execute.- Returns:
- The query to execute
-
getExpandableQueryParts
The query to execute.- Returns:
- The query to execute
-
getQueryBindings
List<QueryParameterBinding> getQueryBindings()The list of query bindings.- Returns:
- the query bindings
-
getResultType
The query result type. This may differ from the root entity type returned bygetRootEntity()
.- Returns:
- The query result type
-
getResultArgument
The query result type. This may differ from the root entity type returned bygetRootEntity()
.- Specified by:
getResultArgument
in interfaceStoredDataOperation<E>
- Returns:
- The query result type
-
getResultDataType
- Returns:
- The result data type.
-
isNative
default boolean isNative()In cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).- Returns:
- Whether the query is native.
-
isProcedure
default boolean isProcedure()Is the query a procedure.- Returns:
- Whether the query is a procedure invocation.
- Since:
- 4.2.0
-
getOperationType
StoredQuery.OperationType getOperationType()Get the operation type.- Returns:
- The operation type.
- Since:
- 4.2.0
-
useNumericPlaceholders
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreAre the placeholders for query set using numeric indices starting from 1.- Returns:
- True if they are.
-
isDtoProjection
default boolean isDtoProjection()Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project. Defaults to false.- Returns:
- Whether the query is a DTO projection query
-
getEntityIdentifierType
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreThe type of the ID member of the entity.- Returns:
- The ID type
-
getArgumentTypes
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreThe argument types to the method that invokes the query.- Returns:
- The argument types
-
isCount
boolean isCount()- Returns:
- Is this a count query.
-
getQueryHints
The parameter binding. That is the mapping between named query parameters and parameters of the method.- Returns:
- The parameter binding.
-
getJoinFetchPaths
@Deprecated(forRemoval=true, since="4.8.1") @NonNull default @NonNull Set<JoinPath> getJoinFetchPaths()Deprecated, for removal: This API element is subject to removal in a future version.UsegetJoinPaths()
and filter the paths- Returns:
- The join paths that require a fetch
-
getJoinPaths
- Returns:
- The all join paths
- Since:
- 4.8.1
-
isSingleResult
Deprecated, for removal: This API element is subject to removal in a future version.Not used anymoreWhether the query can be treated as a single result.- Returns:
- True if it can.
-
hasResultConsumer
boolean hasResultConsumer()- Returns:
- Whether a result consumer is present
-
isOptimisticLock
default boolean isOptimisticLock()Is with an optimistic lock.- Returns:
- the result
-
isRawQuery
boolean isRawQuery()Gets an indicator telling whether underlying query is raw query.- Returns:
- true if it is raw query
-
isJsonEntity
default boolean isJsonEntity()- Returns:
- an indicator telling whether query is handling entities with JSON representation (like Oracle Json View)
- Since:
- 4.0.0
-
getParameterExpressions
Parameter expressions.- Returns:
- Parameter expressions.
- Since:
- 4.5.0
-