Class DefaultStoredQuery<E,RT>
java.lang.Object
io.micronaut.data.model.runtime.DefaultStoredDataOperation<RT>
io.micronaut.data.runtime.query.internal.DefaultStoredQuery<E,RT>
- Type Parameters:
E- The entity typeRT- The result type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource,io.micronaut.core.naming.Named,StoredDataOperation<RT>,StoredQuery<E,RT>
@Internal
public final class DefaultStoredQuery<E,RT>
extends DefaultStoredDataOperation<RT>
implements StoredQuery<E,RT>
Represents a prepared query.
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultStoredQuery(@NonNull io.micronaut.inject.ExecutableMethod<?, ?> method, @NonNull Class<RT> resultType, @NonNull Class<E> rootEntity, @NonNull String query, boolean isCount, HintsCapableRepository repositoryOperations) The default constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NonNull Class<?>[]The argument types to the method that invokes the query.The type of the ID member of the entity.String[]The query to execute.io.micronaut.inject.ExecutableMethod<?,?> @NonNull StringgetName()@NonNull StringgetQuery()The query to execute.The list of query bindings.The parameter binding.@NonNull DataTypeThe query result type.The root entity type.inthashCode()booleanDoes the query have a pageable.booleanbooleanisCount()booleanReturns whether the query returns the actual entity or a Data Transfer Object (DTO) project.booleanbooleanisNative()In cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).booleanIs with an optimistic lock.booleanGets an indicator telling whether underlying query is raw query.booleanWhether the query can be treated as a single result.booleanIs this a raw SQL query.Methods inherited from class io.micronaut.data.model.runtime.DefaultStoredDataOperation
getAnnotationMetadata, getResultArgumentMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, 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 io.micronaut.data.model.runtime.StoredQuery
getResultArgument
-
Constructor Details
-
DefaultStoredQuery
public DefaultStoredQuery(@NonNull @NonNull io.micronaut.inject.ExecutableMethod<?, ?> method, @NonNull @NonNull Class<RT> resultType, @NonNull @NonNull Class<E> rootEntity, @NonNull @NonNull String query, boolean isCount, HintsCapableRepository repositoryOperations) The default constructor.- Parameters:
method- The target methodresultType- The result type of the queryrootEntity- The root entity of the queryquery- The query itselfisCount- Is the query a count queryrepositoryOperations- The repositoryOperations
-
-
Method Details
-
getQueryBindings
Description copied from interface:StoredQueryThe list of query bindings.- Specified by:
getQueryBindingsin interfaceStoredQuery<E,RT> - Returns:
- the query bindings
-
getJoinFetchPaths
- Specified by:
getJoinFetchPathsin interfaceStoredQuery<E,RT> - Returns:
- The join paths that require a fetch
-
getMethod
public io.micronaut.inject.ExecutableMethod<?,?> getMethod()- Returns:
- The method
-
isSingleResult
public boolean isSingleResult()Description copied from interface:StoredQueryWhether the query can be treated as a single result.- Specified by:
isSingleResultin interfaceStoredQuery<E,RT> - Returns:
- True if it can.
-
hasResultConsumer
public boolean hasResultConsumer()- Specified by:
hasResultConsumerin interfaceStoredQuery<E,RT> - Returns:
- Whether a result consumer is present
-
isCount
public boolean isCount()- Specified by:
isCountin interfaceStoredQuery<E,RT> - Returns:
- Is this a count query.
-
getQueryHints
Description copied from interface:StoredQueryThe parameter binding. That is the mapping between named query parameters and parameters of the method.- Specified by:
getQueryHintsin interfaceStoredQuery<E,RT> - Returns:
- The parameter binding.
-
isNative
public boolean isNative()Description copied from interface:StoredQueryIn cases where one needs to differentiate between at higher level query format (like JPA-QL) and a lower level format (like SQL).- Specified by:
isNativein interfaceStoredQuery<E,RT> - Returns:
- Whether the query is native.
-
useNumericPlaceholders
public boolean useNumericPlaceholders()Is this a raw SQL query.- Specified by:
useNumericPlaceholdersin interfaceStoredQuery<E,RT> - Returns:
- The raw sql query.
-
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,RT> - Returns:
- Whether the query is a DTO query
-
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,RT> - Returns:
- The result type
-
getResultDataType
- Specified by:
getResultDataTypein interfaceStoredQuery<E,RT> - Returns:
- The result data type.
-
getEntityIdentifierType
Description copied from interface:StoredQueryThe type of the ID member of the entity.- Specified by:
getEntityIdentifierTypein interfaceStoredQuery<E,RT> - Returns:
- The ID type
-
getRootEntity
Description copied from interface:StoredQueryThe root entity type.- Specified by:
getRootEntityin interfaceStoredQuery<E,RT> - Returns:
- The root entity type
-
hasPageable
public boolean hasPageable()Description copied from interface:StoredQueryDoes the query have a pageable.- Specified by:
hasPageablein interfaceStoredQuery<E,RT> - Returns:
- True if it does
-
getQuery
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getQueryin interfaceStoredQuery<E,RT> - Returns:
- The query to execute
-
getExpandableQueryParts
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getExpandableQueryPartsin interfaceStoredQuery<E,RT> - Returns:
- The query to execute
-
getName
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getArgumentTypes
Description copied from interface:StoredQueryThe argument types to the method that invokes the query.- Specified by:
getArgumentTypesin interfaceStoredQuery<E,RT> - Returns:
- The argument types
-
isOptimisticLock
public boolean isOptimisticLock()Description copied from interface:StoredQueryIs with an optimistic lock.- Specified by:
isOptimisticLockin interfaceStoredQuery<E,RT> - Returns:
- the result
-
isRawQuery
public boolean isRawQuery()Description copied from interface:StoredQueryGets an indicator telling whether underlying query is raw query.- Specified by:
isRawQueryin interfaceStoredQuery<E,RT> - Returns:
- true if it is raw query
-
isJsonEntity
public boolean isJsonEntity()- Specified by:
isJsonEntityin interfaceStoredQuery<E,RT> - Returns:
- an indicator telling whether query is handling entities with JSON representation (like Oracle Json View)
-
equals
-
hashCode
public int hashCode()
-