Class QueryResultStoredQuery<E,R>
java.lang.Object
io.micronaut.data.runtime.query.internal.BasicStoredQuery<E,R>
io.micronaut.data.runtime.query.internal.QueryResultStoredQuery<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.naming.Named, StoredDataOperation<R>, StoredQuery<E,R>
The basic
StoredQuery created from QueryResult.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface StoredQuery
StoredQuery.OperationType -
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionQueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, boolean isDto, boolean embeddedProjection, boolean optionalEmbeddedProjection, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) QueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, boolean isDto, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) QueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> QueryResultStoredQuery<T, Long> count(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity) static <T,R> QueryResultStoredQuery <T, R> embeddedProjection(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean single, boolean pageable, boolean optional, Collection<JoinPath> joinPaths) Creates a query stored query projecting an embedded property.OUT parameters metadata for this stored query (e.g.static <T> QueryResultStoredQuery<T, T> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, boolean pageable) static <T,R> QueryResultStoredQuery <T, R> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean pageable, boolean isDto, Collection<JoinPath> joinPaths) static <T,R> QueryResultStoredQuery <T, R> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean pageable, Collection<JoinPath> joinPaths) static <T> QueryResultStoredQuery<T, T> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity) static <T,R> QueryResultStoredQuery <T, R> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean isDto, Collection<JoinPath> joinPaths) static <T,R> QueryResultStoredQuery <T, R> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, Collection<JoinPath> joinPaths) Methods inherited from class BasicStoredQuery
getAnnotationMetadata, getExpandableQueryParts, getName, getOperationType, getQuery, getQueryBindings, getResultArgument, getResultDataType, getResultType, getRootEntity, hasPageable, hasResultConsumer, isCount, isDtoProjection, isOptionalEmbeddedProjection, isRawQueryMethods inherited from class 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 StoredQuery
getParameterExpressions, getQueryHints, getQueryLimit, getSort, isJsonEntity, isNative, isOptimisticLock, isProcedure
-
Constructor Details
-
QueryResultStoredQuery
public QueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) -
QueryResultStoredQuery
public QueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, boolean isDto, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) -
QueryResultStoredQuery
public QueryResultStoredQuery(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<E> rootEntity, Class<R> resultType, boolean pageable, boolean isCount, boolean isDto, boolean embeddedProjection, boolean optionalEmbeddedProjection, StoredQuery.OperationType operationType, Collection<JoinPath> joinPaths) - Parameters:
name- The nameannotationMetadata- The annotation metadataqueryResult- The query resultrootEntity- The root entityresultType- The result typepageable- Whether the query is pageableisCount- Whether the query is a count queryisDto- Whether the query is a DTO projectionembeddedProjection- Whether the query projects an embedded propertyoptionalEmbeddedProjection- Whether the projected embedded property is optionaloperationType- The operation typejoinPaths- The join paths- Since:
- 5.2.0
-
-
Method Details
-
single
public static <T> QueryResultStoredQuery<T,T> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity) -
single
public static <T,R> QueryResultStoredQuery<T,R> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, Collection<JoinPath> joinPaths) -
single
public static <T,R> QueryResultStoredQuery<T,R> single(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean isDto, Collection<JoinPath> joinPaths) -
many
public static <T> QueryResultStoredQuery<T,T> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, boolean pageable) -
many
public static <T,R> QueryResultStoredQuery<T,R> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean pageable, Collection<JoinPath> joinPaths) -
many
public static <T,R> QueryResultStoredQuery<T,R> many(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean pageable, boolean isDto, Collection<JoinPath> joinPaths) -
embeddedProjection
public static <T,R> QueryResultStoredQuery<T,R> embeddedProjection(StoredQuery.OperationType operationType, String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity, Class<R> resultType, boolean single, boolean pageable, boolean optional, Collection<JoinPath> joinPaths) Creates a query stored query projecting an embedded property.- Type Parameters:
T- The root entity typeR- The result type- Parameters:
operationType- The operation typename- The nameannotationMetadata- The annotation metadataqueryResult- The query resultrootEntity- The root entityresultType- The embeddable result typesingle- Whether the query returns a single resultpageable- Whether the query is pageableoptional- Whether the projected embedded property is optionaljoinPaths- The join paths- Returns:
- The stored query
- Since:
- 5.2.0
-
count
public static <T> QueryResultStoredQuery<T,Long> count(String name, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryResult queryResult, Class<T> rootEntity) -
getQueryResult
-
getOutParameterBindings
Description copied from interface:StoredQueryOUT parameters metadata for this stored query (e.g. Oracle RETURNING ... INTO ...). Order corresponds to the order in which OUT parameters must be registered.- Returns:
- list of OUT parameter bindings or empty if none
-
getJoinPaths
-