Class DefaultSqlPreparedQuery<E,R>
java.lang.Object
io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery<E,R>
io.micronaut.data.runtime.operations.internal.sql.DefaultSqlPreparedQuery<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.attr.AttributeHolder,io.micronaut.core.naming.Named,PagedQuery<E>,PreparedDataOperation<R>,PreparedQuery<E,,R> StoredDataOperation<R>,StoredQuery<E,,R> BindableParametersPreparedQuery<E,,R> BindableParametersStoredQuery<E,,R> PersistentEntityAwareQuery<E>,SqlPreparedQuery<E,,R> SqlStoredQuery<E,,R> DelegatePreparedQuery<E,,R> DelegateStoredQuery<E,R>
@Internal
public class DefaultSqlPreparedQuery<E,R>
extends DefaultBindableParametersPreparedQuery<E,R>
implements SqlPreparedQuery<E,R>, DelegatePreparedQuery<E,R>
Implementation of
SqlPreparedQuery.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.runtime.operations.internal.query.BindableParametersStoredQuery
BindableParametersStoredQuery.Binder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected final QueryResultInfoprotected final SqlStoredQuery<E,R> Fields inherited from class io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery
invocationContext, preparedQuery, storedQueryFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSqlPreparedQuery(PreparedQuery<E, R> preparedQuery) DefaultSqlPreparedQuery(PreparedQuery<E, R> preparedQuery, SqlStoredQuery<E, R> sqlStoredQuery) DefaultSqlPreparedQuery(SqlStoredQuery<E, R> sqlStoredQuery) -
Method Summary
Modifier and TypeMethodDescriptionvoidattachPageable(Pageable pageable, boolean isSingleResult) Modify the query according to the pageable.collectAutoPopulatedPreviousValues(E entity) Collect auto-populated property values before pre-actions are triggered and property values are modified.Get dialect.getQuery()The query to execute.protected intgetQueryParameterValueSize(QueryParameterBinding parameter) Gets number of parameter values for the query parameter binding (used for IN for example).booleanvoidCheck if query need to be modified to expand parameters.protected intCompute the size of the given object.Methods inherited from class io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery
bindParameters, bindParametersMethods inherited from class java.lang.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 io.micronaut.data.runtime.operations.internal.query.BindableParametersPreparedQuery
bindParameters, bindParametersMethods inherited from interface io.micronaut.data.runtime.operations.internal.query.BindableParametersStoredQuery
bindParametersMethods inherited from interface io.micronaut.data.runtime.query.internal.DelegatePreparedQuery
getArguments, getAttribute, getAttribute, getAttributes, getPageable, getParameterArray, getParameterInRole, getParameterValues, getQueryHints, getRepositoryType, getRootEntity, getStoredQueryDelegate, isDtoProjection, isRawQueryMethods inherited from interface io.micronaut.data.runtime.query.internal.DelegateStoredQuery
getAnnotationMetadata, getArgumentTypes, getEntityIdentifierType, getExpandableQueryParts, getIndexedParameterAutoPopulatedPreviousPropertyIndexes, getIndexedParameterAutoPopulatedPreviousPropertyPaths, getIndexedParameterAutoPopulatedPropertyPaths, getJoinFetchPaths, getName, getQueryBindings, getResultArgument, getResultDataType, getResultType, getTransactionDefinition, hasPageable, hasResultConsumer, isCount, isJsonEntity, isNative, isOptimisticLock, isSingleResult, useNumericPlaceholdersMethods inherited from interface io.micronaut.data.model.runtime.StoredQuery
getIndexedParameterBinding, getIndexedParameterPaths, getIndexedParameterTypes, getLastUpdatedProperty, getParameterBinding, getParameterNames, hasInExpression
-
Field Details
-
sqlStoredQuery
-
query
-
queryResultInfo
-
-
Constructor Details
-
DefaultSqlPreparedQuery
-
DefaultSqlPreparedQuery
public DefaultSqlPreparedQuery(PreparedQuery<E, R> preparedQuery, SqlStoredQuery<E, R> sqlStoredQuery) -
DefaultSqlPreparedQuery
-
-
Method Details
-
getPersistentEntity
- Specified by:
getPersistentEntityin interfacePersistentEntityAwareQuery<E>- Overrides:
getPersistentEntityin classDefaultBindableParametersPreparedQuery<E,R> - Returns:
- The persistent entity
-
getPreparedQueryDelegate
- Specified by:
getPreparedQueryDelegatein interfaceDelegatePreparedQuery<E,R> - Overrides:
getPreparedQueryDelegatein classDefaultBindableParametersPreparedQuery<E,R> - Returns:
- The delegate
-
isExpandableQuery
public boolean isExpandableQuery()- Specified by:
isExpandableQueryin interfaceSqlStoredQuery<E,R> - Returns:
- true if query is expandable
-
getDialect
Description copied from interface:SqlStoredQueryGet dialect.- Specified by:
getDialectin interfaceSqlStoredQuery<E,R> - Returns:
- dialect
-
getQueryBuilder
- Specified by:
getQueryBuilderin interfaceSqlStoredQuery<E,R> - Returns:
- query builder for possible modification in the prepared query
-
getQuery
Description copied from interface:StoredQueryThe query to execute.- Specified by:
getQueryin interfaceDelegatePreparedQuery<E,R> - Specified by:
getQueryin interfaceDelegateStoredQuery<E,R> - Specified by:
getQueryin interfaceStoredQuery<E,R> - Returns:
- The query to execute
-
collectAutoPopulatedPreviousValues
Description copied from interface:SqlStoredQueryCollect auto-populated property values before pre-actions are triggered and property values are modified.- Specified by:
collectAutoPopulatedPreviousValuesin interfaceSqlStoredQuery<E,R> - Parameters:
entity- The entity instance- Returns:
- collected values
-
prepare
Check if query need to be modified to expand parameters.- Specified by:
preparein interfaceSqlPreparedQuery<E,R> - Parameters:
entity- The entity instance
-
getQueryParameterValueSize
Gets number of parameter values for the query parameter binding (used for IN for example).- Parameters:
parameter- the query binding parameter- Returns:
- number of parameter values in query parameter binding
-
attachPageable
Description copied from interface:SqlPreparedQueryModify the query according to the pageable.- Specified by:
attachPageablein interfaceSqlPreparedQuery<E,R> - Parameters:
pageable- The pageableisSingleResult- is single result
-
getQueryResultInfo
- Specified by:
getQueryResultInfoin interfaceSqlPreparedQuery<E,R> - Returns:
- the query result info
-
sizeOf
Compute the size of the given object.- Parameters:
value- The value- Returns:
- The size
-