@SuppressWarnings({ "rawtypes", "unchecked" }) public abstract class DynamicFinder extends AbstractFinder implements QueryBuildingFinder
Abstract base class for dynamic finders.
| Modifiers | Name | Description |
|---|---|---|
static String |
ARGUMENT_CACHE |
|
static String |
ARGUMENT_FETCH |
|
static String |
ARGUMENT_FETCH_SIZE |
|
static String |
ARGUMENT_FLUSH_MODE |
|
static String |
ARGUMENT_IGNORE_CASE |
|
static String |
ARGUMENT_LOCK |
|
static String |
ARGUMENT_MAX |
|
static String |
ARGUMENT_OFFSET |
|
static String |
ARGUMENT_ORDER |
|
static String |
ARGUMENT_READ_ONLY |
|
static String |
ARGUMENT_SORT |
|
static String |
ARGUMENT_TIMEOUT |
|
static String |
ORDER_ASC |
|
static String |
ORDER_DESC |
|
protected MappingContext |
mappingContext |
|
protected Pattern |
pattern |
| Fields inherited from class | Fields |
|---|---|
class AbstractFinder |
datastore |
| Constructor and description |
|---|
protected DynamicFinder(Pattern pattern, String[] operators, Datastore datastore) |
protected DynamicFinder(Pattern pattern, 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, Map sortMap, boolean ignoreCase)Applies sorting logic to the given query from the given map |
|
public static MatchSpec |
buildMatchSpec(String prefix, 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(Class clazz, Query query, Object[] arguments) |
|
public Criterion |
createCriterion() |
|
public DynamicFinderInvocation |
createFinderInvocation(Class clazz, String methodName, Closure additionalCriteria, Object[] arguments) |
|
protected abstract Object |
doInvokeInternal(DynamicFinderInvocation invocation) |
|
protected MethodExpression |
findMethodExpression(Class clazz, String expression) |
|
protected static MethodExpression |
findMethodExpression(String expression) |
|
public Object[] |
getArguments() |
|
public int |
getArgumentsRequired() |
|
public static FetchType |
getFetchMode(Object object)Retrieves the fetch mode for the specified instance; otherwise returns the default FetchMode. |
|
public Object |
invoke(Class clazz, String methodName, Closure additionalCriteria, Object[] arguments) |
|
public Object |
invoke(Class clazz, String methodName, DetachedCriteria detachedCriteria, Object[] arguments) |
|
public Object |
invoke(Class clazz, String methodName, Object[] arguments) |
|
public boolean |
isMethodMatch(String methodName)Checks whether the given method is a match |
|
public static void |
populateArgumentsForCriteria(BuildableCriteria query, Map argMap)Populates arguments for the given query form the given map |
|
public static void |
populateArgumentsForCriteria(Class<?> targetClass, Query query, Map argMap)Populates arguments for the given query form the given map |
|
public static void |
registerNewMethodExpression(Class methodExpression)Registers a new method expression. |
|
public void |
setArguments(Object[] arguments) |
|
public void |
setPattern(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 argumentsPopulates 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