Package org.apache.ofbiz.common
Class FindServices
- java.lang.Object
-
- org.apache.ofbiz.common.FindServices
-
public class FindServices extends java.lang.Object
FindServices Class
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,EntityComparisonOperator<?,?>>
entityOperators
static java.lang.String
module
static java.lang.String
resource
-
Constructor Summary
Constructors Constructor Description FindServices()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>
buildReducedQueryString(java.util.Map<java.lang.String,?> inputFields, java.lang.String entityName, Delegator delegator)
static java.util.List<EntityCondition>
createCondition(ModelEntity modelEntity, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> normalizedFields, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, java.util.Map<java.lang.String,java.util.List<java.lang.Object[]>> origValueMap, Delegator delegator, java.util.Map<java.lang.String,?> context)
createCondition, comparing the normalizedFields with the list of keys, .static java.util.List<EntityCondition>
createConditionList(java.util.Map<java.lang.String,? extends java.lang.Object> parameters, java.util.List<ModelField> fieldList, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, Delegator delegator, java.util.Map<java.lang.String,?> context)
Parses input parameters and returns anEntityCondition
list.static EntityCondition
createSingleCondition(ModelField modelField, java.lang.String operation, java.lang.Object fieldValue, boolean ignoreCase, Delegator delegator, java.util.Map<java.lang.String,?> context)
Creates a singleEntityCondition
based on a set of parameters.static java.util.Map<java.lang.String,java.lang.Object>
executeFind(DispatchContext dctx, java.util.Map<java.lang.String,?> context)
executeFind This is a generic method that returns an EntityListIterator.static java.util.Map<java.lang.String,java.lang.Object>
performFind(DispatchContext dctx, java.util.Map<java.lang.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.static java.util.Map<java.lang.String,java.lang.Object>
performFindItem(DispatchContext dctx, java.util.Map<java.lang.String,java.lang.Object> context)
Returns the first generic item of the service 'performFind' Same parameters as performFind service but returns a single GenericValuestatic java.util.Map<java.lang.String,java.lang.Object>
performFindList(DispatchContext dctx, java.util.Map<java.lang.String,java.lang.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.static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>
prepareField(java.util.Map<java.lang.String,?> inputFields, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, java.util.Map<java.lang.String,java.util.List<java.lang.Object[]>> origValueMap)
prepareField, analyse inputFields to created normalizedFields a map with field name and operator.static java.util.Map<java.lang.String,java.lang.Object>
prepareFind(DispatchContext dctx, java.util.Map<java.lang.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 Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
entityOperators
public static final java.util.Map<java.lang.String,EntityComparisonOperator<?,?>> entityOperators
-
-
Method Detail
-
prepareField
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> prepareField(java.util.Map<java.lang.String,?> inputFields, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, java.util.Map<java.lang.String,java.util.List<java.lang.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 java.util.List<EntityCondition> createConditionList(java.util.Map<java.lang.String,? extends java.lang.Object> parameters, java.util.List<ModelField> fieldList, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, Delegator delegator, java.util.Map<java.lang.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, java.lang.String operation, java.lang.Object fieldValue, boolean ignoreCase, Delegator delegator, java.util.Map<java.lang.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 java.util.List<EntityCondition> createCondition(ModelEntity modelEntity, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> normalizedFields, java.util.Map<java.lang.String,java.lang.Object> queryStringMap, java.util.Map<java.lang.String,java.util.List<java.lang.Object[]>> origValueMap, Delegator delegator, java.util.Map<java.lang.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
public static java.util.Map<java.lang.String,java.lang.Object> performFindList(DispatchContext dctx, java.util.Map<java.lang.String,java.lang.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.- Parameters:
dctx
-context
-- Returns:
- Map
-
performFind
public static java.util.Map<java.lang.String,java.lang.Object> performFind(DispatchContext dctx, java.util.Map<java.lang.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.
-
prepareFind
public static java.util.Map<java.lang.String,java.lang.Object> prepareFind(DispatchContext dctx, java.util.Map<java.lang.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.
-
executeFind
public static java.util.Map<java.lang.String,java.lang.Object> executeFind(DispatchContext dctx, java.util.Map<java.lang.String,?> context)
executeFind This is a generic method that returns an EntityListIterator.
-
buildReducedQueryString
public static java.util.Map<java.lang.String,java.lang.Object> buildReducedQueryString(java.util.Map<java.lang.String,?> inputFields, java.lang.String entityName, Delegator delegator)
-
performFindItem
public static java.util.Map<java.lang.String,java.lang.Object> performFindItem(DispatchContext dctx, java.util.Map<java.lang.String,java.lang.Object> context)
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
-
-