@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public abstract class DynamicFinder extends AbstractFinder implements QueryBuildingFinder
Abstract base class for dynamic finders.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
ARGUMENT_CACHE |
|
static java.lang.String |
ARGUMENT_FETCH |
|
static java.lang.String |
ARGUMENT_FETCH_SIZE |
|
static java.lang.String |
ARGUMENT_FLUSH_MODE |
|
static java.lang.String |
ARGUMENT_IGNORE_CASE |
|
static java.lang.String |
ARGUMENT_LOCK |
|
static java.lang.String |
ARGUMENT_MAX |
|
static java.lang.String |
ARGUMENT_OFFSET |
|
static java.lang.String |
ARGUMENT_ORDER |
|
static java.lang.String |
ARGUMENT_READ_ONLY |
|
static java.lang.String |
ARGUMENT_SORT |
|
static java.lang.String |
ARGUMENT_TIMEOUT |
|
static java.lang.String |
ORDER_ASC |
|
static java.lang.String |
ORDER_DESC |
|
protected MappingContext |
mappingContext |
|
protected java.util.regex.Pattern |
pattern |
Fields inherited from class | Fields |
---|---|
class AbstractFinder |
datastore |
Constructor and description |
---|
protected DynamicFinder
(java.util.regex.Pattern pattern, java.lang.String[] operators, Datastore datastore) |
protected DynamicFinder
(java.util.regex.Pattern pattern, java.lang.String[] operators, MappingContext mappingContext) |
Type Params | Return Type | Name and description |
---|---|---|
|
public static void |
applyDetachedCriteria(Query query, AbstractDetachedCriteria detachedCriteria) Applies the given detached criteria to the given query |
|
public static void |
applySortForMap(Query query, java.util.Map sortMap, boolean ignoreCase) Applies sorting logic to the given query from the given map |
|
public static MatchSpec |
buildMatchSpec(java.lang.String prefix, java.lang.String methodName, int parameterCount) Builds a match specification that can be used to establish information about a dynamic finder compilation for the purposes of compilation etc. |
|
protected void |
configureQueryWithArguments(java.lang.Class clazz, Query query, java.lang.Object[] arguments) |
|
public Criterion |
createCriterion() |
|
public DynamicFinderInvocation |
createFinderInvocation(java.lang.Class clazz, java.lang.String methodName, groovy.lang.Closure additionalCriteria, java.lang.Object[] arguments) |
|
protected abstract java.lang.Object |
doInvokeInternal(DynamicFinderInvocation invocation) |
|
protected MethodExpression |
findMethodExpression(java.lang.Class clazz, java.lang.String expression) |
|
protected static MethodExpression |
findMethodExpression(java.lang.String expression) |
|
public java.lang.Object[] |
getArguments() |
|
public int |
getArgumentsRequired() |
|
public static javax.persistence.FetchType |
getFetchMode(java.lang.Object object) Retrieves the fetch mode for the specified instance; otherwise returns the default FetchMode. |
|
public java.lang.Object |
invoke(java.lang.Class clazz, java.lang.String methodName, groovy.lang.Closure additionalCriteria, java.lang.Object[] arguments) |
|
public java.lang.Object |
invoke(java.lang.Class clazz, java.lang.String methodName, DetachedCriteria detachedCriteria, java.lang.Object[] arguments) |
|
public java.lang.Object |
invoke(java.lang.Class clazz, java.lang.String methodName, java.lang.Object[] arguments) |
|
public boolean |
isMethodMatch(java.lang.String methodName) Checks whether the given method is a match |
|
public static void |
populateArgumentsForCriteria(BuildableCriteria query, java.util.Map argMap) Populates arguments for the given query form the given map |
|
public static void |
populateArgumentsForCriteria(java.lang.Class<? extends java.lang.Object> targetClass, Query query, java.util.Map argMap) |
|
public static void |
registerNewMethodExpression(java.lang.Class methodExpression) Registers a new method expression. |
|
public void |
setArguments(java.lang.Object[] arguments) |
|
public void |
setPattern(java.lang.String pattern) Sets the pattern to use for this finder |
Methods inherited from class | Name |
---|---|
class AbstractFinder |
applyAdditionalCriteria, execute, execute |
Applies the given detached criteria to the given query
query
- The querydetachedCriteria
- The detached criteriaApplies sorting logic to the given query from the given map
query
- The querysortMap
- The sort mapignoreCase
- Whether toi ignore caseBuilds a match specification that can be used to establish information about a dynamic finder compilation for the purposes of compilation etc.
prefix
- The dynamic finder prefix. For example 'findBy'methodName
- The full method nameparameterCount
- The number of parametersRetrieves the fetch mode for the specified instance; otherwise returns the default FetchMode.
object
- The object, converted to a stringChecks whether the given method is a match
methodName
- The method namePopulates arguments for the given query form the given map
query
- The queryargMap
- The query argumentsRegisters a new method expression. The Class must extends from the class MethodExpression and provide a constructor that accepts a Class parameter and a String parameter.
methodExpression
- A class that extends from MethodExpressionSets the pattern to use for this finder
pattern
- A regular expression