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 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 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildMatchInfo, getOrder
protected AbstractPatternBasedMethod(@NonNull java.util.regex.Pattern pattern)
pattern
- The pattern to matchpublic boolean isMethodMatch(@NonNull io.micronaut.inject.ast.MethodElement methodElement, @NonNull MatchContext matchContext)
MethodCandidate
isMethodMatch
in interface MethodCandidate
methodElement
- 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 queryprotected 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 specs@NonNull protected MethodMatchInfo.OperationType getOperationType()