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
Nested classes/interfaces inherited from interface io.micronaut.data.model.runtime.StoredQuery
StoredQuery.OperationType
-
Field Summary
Fields inherited from class io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery
invocationContext, preparedQuery, storedQuery
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Constructor Summary
ConstructorDescriptionDefaultSqlPreparedQuery
(PreparedQuery<E, R> preparedQuery) DefaultSqlPreparedQuery
(PreparedQuery<E, R> preparedQuery, SqlStoredQuery<E, R> sqlStoredQuery) DefaultSqlPreparedQuery
(SqlStoredQuery<E, R> sqlStoredQuery) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachPageable
(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 int
getQueryParameterValueSize
(QueryParameterBinding parameter) Gets number of parameter values for the query parameter binding (used for IN for example).boolean
void
Check if query need to be modified to expand parameters.protected int
Compute the size of the given object.Methods inherited from class io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery
bindParameters, bindParameters, bindParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, 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.data.runtime.operations.internal.query.BindableParametersPreparedQuery
bindParameters, bindParameters
Methods inherited from interface io.micronaut.data.runtime.operations.internal.query.BindableParametersStoredQuery
bindParameters
Methods inherited from interface io.micronaut.data.runtime.query.internal.DelegatePreparedQuery
getArguments, getAttribute, getAttribute, getAttributes, getPageable, getParameterArray, getParameterInRole, getQueryHints, getRepositoryType, getRootEntity, getStoredQueryDelegate, isDtoProjection, isRawQuery
Methods inherited from interface io.micronaut.data.runtime.query.internal.DelegateStoredQuery
getAnnotationMetadata, getArgumentTypes, getEntityIdentifierType, getExpandableQueryParts, getJoinFetchPaths, getName, getOperationType, getQueryBindings, getResultArgument, getResultDataType, getResultType, hasPageable, hasResultConsumer, isCount, isJsonEntity, isNative, isOptimisticLock, isProcedure, isSingleResult, useNumericPlaceholders
-
Field Details
-
sqlStoredQuery
-
query
-
-
Constructor Details
-
DefaultSqlPreparedQuery
-
DefaultSqlPreparedQuery
public DefaultSqlPreparedQuery(PreparedQuery<E, R> preparedQuery, SqlStoredQuery<E, R> sqlStoredQuery) -
DefaultSqlPreparedQuery
-
-
Method Details
-
getPersistentEntity
- Specified by:
getPersistentEntity
in interfacePersistentEntityAwareQuery<E>
- Overrides:
getPersistentEntity
in classDefaultBindableParametersPreparedQuery<E,
R> - Returns:
- The persistent entity
-
getPreparedQueryDelegate
- Specified by:
getPreparedQueryDelegate
in interfaceDelegatePreparedQuery<E,
R> - Overrides:
getPreparedQueryDelegate
in classDefaultBindableParametersPreparedQuery<E,
R> - Returns:
- The delegate
-
isExpandableQuery
public boolean isExpandableQuery()- Specified by:
isExpandableQuery
in interfaceSqlStoredQuery<E,
R> - Returns:
- true if query is expandable
-
getDialect
Description copied from interface:SqlStoredQuery
Get dialect.- Specified by:
getDialect
in interfaceSqlStoredQuery<E,
R> - Returns:
- dialect
-
getQueryBuilder
- Specified by:
getQueryBuilder
in interfaceSqlStoredQuery<E,
R> - Returns:
- query builder for possible modification in the prepared query
-
getQuery
Description copied from interface:StoredQuery
The query to execute.- Specified by:
getQuery
in interfaceDelegatePreparedQuery<E,
R> - Specified by:
getQuery
in interfaceDelegateStoredQuery<E,
R> - Specified by:
getQuery
in interfaceStoredQuery<E,
R> - Returns:
- The query to execute
-
collectAutoPopulatedPreviousValues
Description copied from interface:SqlStoredQuery
Collect auto-populated property values before pre-actions are triggered and property values are modified.- Specified by:
collectAutoPopulatedPreviousValues
in interfaceSqlStoredQuery<E,
R> - Parameters:
entity
- The entity instance- Returns:
- collected values
-
prepare
Check if query need to be modified to expand parameters.- Specified by:
prepare
in 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:SqlPreparedQuery
Modify the query according to the pageable.- Specified by:
attachPageable
in interfaceSqlPreparedQuery<E,
R> - Parameters:
pageable
- The pageableisSingleResult
- is single result
-
getQueryResultInfo
- Specified by:
getQueryResultInfo
in interfaceSqlPreparedQuery<E,
R> - Specified by:
getQueryResultInfo
in interfaceSqlStoredQuery<E,
R> - Returns:
- the query result info
-
sizeOf
Compute the size of the given object.- Parameters:
value
- The value- Returns:
- The size
-