E
- The entity typeRT
- The result type@Internal public final class DefaultPreparedQuery<E,RT> extends DefaultStoredDataOperation<RT> implements PreparedQuery<E,RT>
NO_TRANSACTION
Constructor and Description |
---|
DefaultPreparedQuery(io.micronaut.aop.MethodInvocationContext<?,?> context,
StoredQuery<E,RT> storedQuery,
java.lang.String finalQuery,
Pageable pageable,
boolean dtoProjection,
io.micronaut.core.convert.ConversionService<?> conversionService)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
io.micronaut.core.type.Argument[] |
getArguments() |
java.lang.Class<?>[] |
getArgumentTypes()
The argument types to the method that invokes the query.
|
java.util.Optional<java.lang.Object> |
getAttribute(java.lang.CharSequence name) |
<T> java.util.Optional<T> |
getAttribute(java.lang.CharSequence name,
java.lang.Class<T> type) |
io.micronaut.core.convert.value.ConvertibleValues<java.lang.Object> |
getAttributes() |
java.util.Optional<java.lang.Class<?>> |
getEntityIdentifierType()
The type of the ID member of the entity.
|
java.lang.String[] |
getExpandableQueryParts()
The query to execute.
|
int[] |
getIndexedParameterAutoPopulatedPreviousPropertyIndexes()
The mapping between query parameters and auto populated previous properties that the parameter represents.
|
java.lang.String[] |
getIndexedParameterAutoPopulatedPreviousPropertyPaths()
The mapping between query parameters and auto populated previous properties that the parameter represents.
|
java.lang.String[] |
getIndexedParameterAutoPopulatedPropertyPaths()
The mapping between query parameters and auto populated properties that the parameter represents.
|
java.util.Set<JoinPath> |
getJoinFetchPaths() |
java.lang.String |
getName() |
Pageable |
getPageable() |
java.lang.Object[] |
getParameterArray() |
java.util.Map<java.lang.String,java.lang.String> |
getParameterBinding()
The parameter binding.
|
<RT1> java.util.Optional<RT1> |
getParameterInRole(java.lang.String role,
java.lang.Class<RT1> type)
Return the value of the given parameter if the given role.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameterValues() |
java.lang.String |
getQuery()
The query to execute.
|
java.util.List<QueryParameterBinding> |
getQueryBindings()
The list of query bindings.
|
java.util.Map<java.lang.String,java.lang.Object> |
getQueryHints()
The parameter binding.
|
java.lang.Class<?> |
getRepositoryType() |
DataType |
getResultDataType() |
java.lang.Class<RT> |
getResultType()
The query result type.
|
java.lang.Class<E> |
getRootEntity()
The root entity type.
|
java.lang.String |
getUpdate()
The query to execute.
|
boolean |
hasInExpression()
Deprecated.
|
boolean |
hasPageable()
Does the query have a pageable.
|
boolean |
hasResultConsumer() |
boolean |
isCount() |
boolean |
isDtoProjection()
Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project.
|
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).
|
boolean |
isOptimisticLock()
Is with an optimistic lock.
|
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.
|
getAnnotationMetadata, getResultArgument, getTransactionDefinition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLastUpdatedType
getIndexedParameterBinding, getIndexedParameterPaths, getIndexedParameterTypes, getLastUpdatedProperty, getParameterNames, getResultArgument
getTransactionDefinition
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
public DefaultPreparedQuery(io.micronaut.aop.MethodInvocationContext<?,?> context, StoredQuery<E,RT> storedQuery, java.lang.String finalQuery, @NonNull Pageable pageable, boolean dtoProjection, io.micronaut.core.convert.ConversionService<?> conversionService)
context
- The execution contextstoredQuery
- The stored queryfinalQuery
- The final querypageable
- The pageabledtoProjection
- Whether the prepared query is a dto projectionconversionService
- The conversion servicepublic java.lang.String[] getExpandableQueryParts()
StoredQuery
getExpandableQueryParts
in interface StoredQuery<E,RT>
public java.util.List<QueryParameterBinding> getQueryBindings()
StoredQuery
getQueryBindings
in interface StoredQuery<E,RT>
public <RT1> java.util.Optional<RT1> getParameterInRole(@NonNull java.lang.String role, @NonNull java.lang.Class<RT1> type)
PreparedDataOperation
getParameterInRole
in interface PreparedDataOperation<RT>
RT1
- The generic typerole
- The roletype
- The typepublic boolean hasResultConsumer()
hasResultConsumer
in interface StoredQuery<E,RT>
@NonNull public java.util.Set<JoinPath> getJoinFetchPaths()
getJoinFetchPaths
in interface StoredQuery<E,RT>
public boolean isSingleResult()
StoredQuery
isSingleResult
in interface StoredQuery<E,RT>
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getQueryHints()
PagedQuery
getQueryHints
in interface PagedQuery<E>
getQueryHints
in interface PreparedQuery<E,RT>
getQueryHints
in interface StoredQuery<E,RT>
public java.lang.Class<?> getRepositoryType()
getRepositoryType
in interface PreparedQuery<E,RT>
@NonNull public java.util.Map<java.lang.String,java.lang.Object> getParameterValues()
getParameterValues
in interface PreparedQuery<E,RT>
public java.lang.Object[] getParameterArray()
getParameterArray
in interface PreparedQuery<E,RT>
public io.micronaut.core.type.Argument[] getArguments()
getArguments
in interface PreparedQuery<E,RT>
@NonNull public Pageable getPageable()
getPageable
in interface PagedQuery<E>
Pageable.UNPAGED
public boolean isNative()
StoredQuery
isNative
in interface StoredQuery<E,RT>
public boolean useNumericPlaceholders()
StoredQuery
useNumericPlaceholders
in interface StoredQuery<E,RT>
public boolean isDtoProjection()
StoredQuery
isDtoProjection
in interface StoredQuery<E,RT>
@NonNull public java.lang.Class<RT> getResultType()
StoredQuery
StoredQuery.getRootEntity()
.getResultType
in interface StoredQuery<E,RT>
@NonNull public DataType getResultDataType()
getResultDataType
in interface StoredQuery<E,RT>
@Nullable public java.util.Optional<java.lang.Class<?>> getEntityIdentifierType()
StoredQuery
getEntityIdentifierType
in interface StoredQuery<E,RT>
@NonNull public java.lang.Class<E> getRootEntity()
PagedQuery
getRootEntity
in interface PagedQuery<E>
getRootEntity
in interface StoredQuery<E,RT>
@Deprecated public boolean hasInExpression()
StoredQuery
hasInExpression
in interface StoredQuery<E,RT>
public boolean hasPageable()
StoredQuery
hasPageable
in interface StoredQuery<E,RT>
@NonNull public java.lang.String getQuery()
StoredQuery
getQuery
in interface StoredQuery<E,RT>
public java.lang.String getUpdate()
StoredQuery
getUpdate
in interface StoredQuery<E,RT>
@NonNull public java.lang.Class<?>[] getArgumentTypes()
StoredQuery
getArgumentTypes
in interface StoredQuery<E,RT>
@NonNull public java.util.Map<java.lang.String,java.lang.String> getParameterBinding()
StoredQuery
getParameterBinding
in interface StoredQuery<E,RT>
public boolean isCount()
isCount
in interface StoredQuery<E,RT>
@NonNull public java.lang.String getName()
getName
in interface io.micronaut.core.naming.Named
@NonNull public io.micronaut.core.convert.value.ConvertibleValues<java.lang.Object> getAttributes()
getAttributes
in interface io.micronaut.core.attr.AttributeHolder
@NonNull public java.util.Optional<java.lang.Object> getAttribute(java.lang.CharSequence name)
getAttribute
in interface io.micronaut.core.attr.AttributeHolder
@NonNull public <T> java.util.Optional<T> getAttribute(java.lang.CharSequence name, java.lang.Class<T> type)
getAttribute
in interface io.micronaut.core.attr.AttributeHolder
@Nullable public java.lang.String[] getIndexedParameterAutoPopulatedPropertyPaths()
StoredQuery
getIndexedParameterAutoPopulatedPropertyPaths
in interface StoredQuery<E,RT>
public java.lang.String[] getIndexedParameterAutoPopulatedPreviousPropertyPaths()
StoredQuery
getIndexedParameterAutoPopulatedPreviousPropertyPaths
in interface StoredQuery<E,RT>
public int[] getIndexedParameterAutoPopulatedPreviousPropertyIndexes()
StoredQuery
getIndexedParameterAutoPopulatedPreviousPropertyIndexes
in interface StoredQuery<E,RT>
public boolean isOptimisticLock()
StoredQuery
isOptimisticLock
in interface StoredQuery<E,RT>