public abstract class AbstractPatternBasedMethod extends java.lang.Object implements MethodCandidate
| Modifier and Type | Field and Description |
|---|---|
protected java.util.regex.Pattern |
pattern |
DEFAULT_POSITION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPatternBasedMethod(java.util.regex.Pattern pattern)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyForUpdate(QueryModel query)
Apply for update.
|
protected boolean |
applyJoinSpecs(MethodMatchContext matchContext,
QueryModel query,
SourcePersistentEntity rootEntity,
java.util.List<io.micronaut.core.annotation.AnnotationValue<Join>> joinSpecs)
Apply the configured join specifications to the given query.
|
protected boolean |
applyOrderBy(MethodMatchContext context,
QueryModel query,
java.util.List<Sort.Order> orderList)
Apply ordering.
|
protected MethodMatchInfo |
buildInfo(MethodMatchContext matchContext,
io.micronaut.inject.ast.ClassElement queryResultType,
QueryModel query)
Build the
MethodMatchInfo. |
protected RawQuery |
buildRawQuery(MethodMatchContext matchContext)
Builds a raw query for the given match context.
|
protected io.micronaut.inject.ast.ClassElement |
getInterceptorElement(MethodMatchContext matchContext,
java.lang.Class<? extends DataInterceptor> type)
Obtain the interceptor element for the given class.
|
protected io.micronaut.inject.ast.ClassElement |
getInterceptorElement(MethodMatchContext matchContext,
java.lang.String type)
Obtain the interceptor element for the given class name.
|
protected MethodMatchInfo.OperationType |
getOperationType() |
boolean |
isMethodMatch(io.micronaut.inject.ast.MethodElement methodElement,
MatchContext matchContext)
Whether the given method name matches this finder.
|
protected boolean |
isPage(MethodMatchContext matchContext,
io.micronaut.inject.ast.ClassElement typeArgument) |
protected boolean |
isSlice(MethodMatchContext matchContext,
io.micronaut.inject.ast.ClassElement typeArgument) |
protected java.util.List<io.micronaut.core.annotation.AnnotationValue<Join>> |
joinSpecsAtMatchContext(MethodMatchContext matchContext) |
protected java.lang.String |
matchForUpdate(MethodMatchContext matchContext,
java.lang.String querySequence)
Matches for update definitions in the query sequence.
|
protected java.lang.String |
matchOrder(java.lang.String querySequence,
java.util.List<Sort.Order> orders)
Matches order by definitions in the query sequence.
|
protected void |
matchProjections(MethodMatchContext matchContext,
java.util.List<ProjectionMethodExpression> projectionExpressions,
java.lang.String projectionSequence)
Matches projections.
|
protected java.lang.Class<? extends DataInterceptor> |
resolveFindInterceptor(MethodMatchContext matchContext) |
protected java.lang.Class<? extends DataInterceptor> |
resolveInterceptorType(MethodMatchContext matchContext,
io.micronaut.inject.ast.ClassElement typeArgument,
io.micronaut.inject.ast.ClassElement queryResultType,
QueryModel query,
boolean isPage,
boolean isSlice) |
protected java.lang.Class<? extends DataInterceptor> |
resolveInterceptorTypeByOperationType(MethodMatchInfo.OperationType operationType,
io.micronaut.inject.ast.ClassElement returnType) |
protected java.lang.Class<? extends DataInterceptor> |
resolveReactiveInterceptorType(MethodMatchContext matchContext,
io.micronaut.inject.ast.ClassElement returnType,
io.micronaut.inject.ast.ClassElement queryResultType,
QueryModel query,
boolean isPage,
boolean isSlice) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildMatchInfo, getOrderprotected AbstractPatternBasedMethod(@NonNull
java.util.regex.Pattern pattern)
pattern - The pattern to matchpublic boolean isMethodMatch(@NonNull
io.micronaut.inject.ast.MethodElement methodElement,
@NonNull
MatchContext matchContext)
MethodCandidateisMethodMatch in interface MethodCandidatemethodElement - The method element. Never null.matchContext - The match context. Never null.protected java.lang.String matchOrder(java.lang.String querySequence,
java.util.List<Sort.Order> orders)
querySequence - The query sequenceorders - A list or orders to populateprotected java.lang.String matchForUpdate(MethodMatchContext matchContext, java.lang.String querySequence)
matchContext - querySequence - The query sequenceprotected void matchProjections(@NonNull
MethodMatchContext matchContext,
java.util.List<ProjectionMethodExpression> projectionExpressions,
java.lang.String projectionSequence)
matchContext - The match contextprojectionExpressions - the projection expressionsprojectionSequence - The sequence@Nullable protected MethodMatchInfo buildInfo(@NonNull MethodMatchContext matchContext, @NonNull io.micronaut.inject.ast.ClassElement queryResultType, @Nullable QueryModel query)
MethodMatchInfo.matchContext - The match contextqueryResultType - The query result typequery - The query@Nullable protected java.lang.Class<? extends DataInterceptor> resolveFindInterceptor(@NonNull MethodMatchContext matchContext)
matchContext - The match contextDataInterceptor or null.@Nullable protected java.lang.Class<? extends DataInterceptor> resolveInterceptorTypeByOperationType(MethodMatchInfo.OperationType operationType, io.micronaut.inject.ast.ClassElement returnType)
operationType - Operation TypereturnType - Return TypeDataInterceptor or null.@NonNull protected java.lang.Class<? extends DataInterceptor> resolveReactiveInterceptorType(@NonNull MethodMatchContext matchContext, @NonNull io.micronaut.inject.ast.ClassElement returnType, @NonNull io.micronaut.inject.ast.ClassElement queryResultType, @Nullable QueryModel query, boolean isPage, boolean isSlice)
matchContext - The match contextreturnType - Return TypequeryResultType - Query Result Typequery - QueryisPage - true if the type argument performs the TypeRole.PAGE role.isSlice - true if the type argument performs the TypeRole.SLICE role.DataInterceptor or null.@Nullable protected java.lang.Class<? extends DataInterceptor> resolveInterceptorType(@NonNull MethodMatchContext matchContext, @NonNull io.micronaut.inject.ast.ClassElement typeArgument, @NonNull io.micronaut.inject.ast.ClassElement queryResultType, @Nullable QueryModel query, boolean isPage, boolean isSlice)
matchContext - The match contexttypeArgument - Type ArgumentqueryResultType - Query Result Typequery - QueryisPage - true if the type argument performs the TypeRole.PAGE role.isSlice - true if the type argument performs the TypeRole.SLICE role.DataInterceptor or null.protected boolean isPage(@NonNull
MethodMatchContext matchContext,
@NonNull
io.micronaut.inject.ast.ClassElement typeArgument)
matchContext - The match contexttypeArgument - Type argumentTypeRole.PAGE role.protected boolean isSlice(@NonNull
MethodMatchContext matchContext,
@NonNull
io.micronaut.inject.ast.ClassElement typeArgument)
matchContext - The match contexttypeArgument - type argumentTypeRole.SLICE role.protected io.micronaut.inject.ast.ClassElement getInterceptorElement(@NonNull
MethodMatchContext matchContext,
java.lang.Class<? extends DataInterceptor> type)
matchContext - The match contexttype - The typeprotected io.micronaut.inject.ast.ClassElement getInterceptorElement(@NonNull
MethodMatchContext matchContext,
java.lang.String type)
matchContext - The match contexttype - The typeprotected boolean applyOrderBy(@NonNull
MethodMatchContext context,
@NonNull
QueryModel query,
@NonNull
java.util.List<Sort.Order> orderList)
context - The contextquery - The queryorderList - The list mutateprotected void applyForUpdate(QueryModel query)
query - The query@NonNull protected java.util.List<io.micronaut.core.annotation.AnnotationValue<Join>> joinSpecsAtMatchContext(@NonNull MethodMatchContext matchContext)
matchContext - The match contextprotected boolean applyJoinSpecs(@NonNull
MethodMatchContext matchContext,
@NonNull
QueryModel query,
@Nonnull
SourcePersistentEntity rootEntity,
@NonNull
java.util.List<io.micronaut.core.annotation.AnnotationValue<Join>> joinSpecs)
matchContext - The match contextquery - The queryrootEntity - the root entityjoinSpecs - The join specsprotected RawQuery buildRawQuery(@NonNull MethodMatchContext matchContext)
Query explicitly.matchContext - The match context@NonNull protected MethodMatchInfo.OperationType getOperationType()