Package org.apache.ofbiz.common
Class FindServices
java.lang.Object
org.apache.ofbiz.common.FindServices
FindServices Class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildReducedQueryString
(Map<String, ?> inputFields, String entityName, Delegator delegator) static List<EntityCondition>
createCondition
(ModelEntity modelEntity, Map<String, Map<String, Map<String, Object>>> normalizedFields, Map<String, Object> queryStringMap, Map<String, List<Object[]>> origValueMap, Delegator delegator, Map<String, ?> context) createCondition, comparing the normalizedFields with the list of keys, .static List<EntityCondition>
createConditionList
(Map<String, ? extends Object> parameters, List<ModelField> fieldList, Map<String, Object> queryStringMap, Delegator delegator, Map<String, ?> context) Parses input parameters and returns anEntityCondition
list.static EntityCondition
createSingleCondition
(ModelField modelField, String operation, Object fieldValue, boolean ignoreCase, Delegator delegator, Map<String, ?> context) Creates a singleEntityCondition
based on a set of parameters.executeFind
(DispatchContext dctx, Map<String, ?> context) executeFind This is a generic method that returns an EntityListIterator.performFind
(DispatchContext dctx, Map<String, ?> context) performFind This is a generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement.performFindItem
(DispatchContext dctx, Map<String, Object> context) Returns the first generic item of the service 'performFind' Same parameters as performFind service but returns a single GenericValueperformFindList
(DispatchContext dctx, Map<String, Object> context) same as performFind but now returning a list instead of an iterator Extra parameters viewIndex: startPage of the partial list (0 = first page) viewSize: the length of the page (number of records) Extra output parameter: listSize: size of the totallist list : the list itself.prepareField
(Map<String, ?> inputFields, Map<String, Object> queryStringMap, Map<String, List<Object[]>> origValueMap) prepareField, analyse inputFields to created normalizedFields a map with field name and operator.prepareFind
(DispatchContext dctx, Map<String, ?> context) prepareFind This is a generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement.
-
Field Details
-
ENTITY_OPERATORS
-
-
Constructor Details
-
FindServices
public FindServices()
-
-
Method Details
-
prepareField
public static Map<String,Map<String, prepareFieldMap<String, Object>>> (Map<String, ?> inputFields, Map<String, Object> queryStringMap, Map<String, List<Object[]>> origValueMap) prepareField, analyse inputFields to created normalizedFields a map with field name and operator. This is use to the generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement.- Parameters:
inputFields
- Input parameters run thru UtilHttp.getParameterMap- Returns:
- a map with field name and operator
-
createConditionList
public static List<EntityCondition> createConditionList(Map<String, ? extends Object> parameters, List<ModelField> fieldList, Map<String, Object> queryStringMap, Delegator delegator, Map<String, ?> context) Parses input parameters and returns anEntityCondition
list.- Parameters:
parameters
-fieldList
-queryStringMap
-delegator
-context
-- Returns:
- returns an EntityCondition list
-
createSingleCondition
public static EntityCondition createSingleCondition(ModelField modelField, String operation, Object fieldValue, boolean ignoreCase, Delegator delegator, Map<String, ?> context) Creates a singleEntityCondition
based on a set of parameters.- Parameters:
modelField
-operation
-fieldValue
-ignoreCase
-delegator
-context
-- Returns:
- return an EntityCondition
-
createCondition
public static List<EntityCondition> createCondition(ModelEntity modelEntity, Map<String, Map<String, Map<String, Object>>> normalizedFields, Map<String, Object> queryStringMap, Map<String, List<Object[]>> origValueMap, Delegator delegator, Map<String, ?> context) createCondition, comparing the normalizedFields with the list of keys, . This is use to the generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement.- Parameters:
modelEntity
- the model entity objectnormalizedFields
- list of field the user have populated- Returns:
- a arrayList usable to create an entityCondition
-
performFindList
same as performFind but now returning a list instead of an iterator Extra parameters viewIndex: startPage of the partial list (0 = first page) viewSize: the length of the page (number of records) Extra output parameter: listSize: size of the totallist list : the list itself.- Parameters:
dctx
-context
-- Returns:
- Map
-
performFind
performFind This is a generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement. -
prepareFind
prepareFind This is a generic method that expects entity data affixed with special suffixes to indicate their purpose in formulating an SQL query statement. -
executeFind
executeFind This is a generic method that returns an EntityListIterator. -
buildReducedQueryString
-
performFindItem
Returns the first generic item of the service 'performFind' Same parameters as performFind service but returns a single GenericValue- Parameters:
dctx
-context
-- Returns:
- returns the first item
-