|
SAP NetWeaver 7.11 (EhP1 SP03) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.caf.rt.bol.util.QueryFilterFactory
public class QueryFilterFactory
This class is a factory for creating instances of QueryFilter.
| Field Summary | |
|---|---|
static String |
BO_NODE_REFERENCE_PATH_SEPARATOR
A separator for attributes that are from an associated BO Node. |
static String |
NESTED_STRUCTURE_PATH_SEPARATOR
A separator for attributes that are part of a complex structure. |
| Constructor Summary | |
|---|---|
QueryFilterFactory()
|
|
| Method Summary | |
|---|---|
static QueryFilter |
createBoolOperator(String type)
Deprecated. |
static QueryFilter |
createBracket(String type)
Deprecated. |
static QueryFilter |
createDateFilter(Condition condition,
Date value,
String name)
Deprecated. |
static QueryFilter |
createFilter(Condition condition,
Object value)
Creates a QueryFilter with a given condition. |
static QueryFilter |
createFilter(Object value)
Creates a QueryFilter for a given search value. |
static QueryFilter |
createFilter(Object value,
Condition condition)
Deprecated. |
static QueryFilter |
createFilter(String attributeSpec,
Condition condition,
Object value)
Creates a QueryFilter suitable for the findByMultipleParameters operation. |
static QueryFilter |
createFilterForBetween(Object valueLow,
Object valueHigh)
Creates a QueryFilter for searching in a range. |
static QueryFilter |
createFilterForBetween(String attributeSpec,
Object valueLow,
Object valueHigh)
Creates a QueryFilter for searching in a range. |
static QueryFilter |
createFreetextFilter(String action,
String value)
Deprecated. |
static QueryFilter |
createNumericFilter(Condition condition,
int value,
String name,
boolean bAttribute)
Deprecated. |
static QueryFilter |
createQueryFilter()
Creates an empty query filter. |
static QueryFilter |
createStringFilter(String action,
String value,
String name,
boolean bAttribute)
Deprecated. |
static QueryFilter |
getQueryFilter(Object value)
Deprecated. |
static Object |
nullToWildcard(Object value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String BO_NODE_REFERENCE_PATH_SEPARATOR
public static final String NESTED_STRUCTURE_PATH_SEPARATOR
| Constructor Detail |
|---|
public QueryFilterFactory()
| Method Detail |
|---|
public static QueryFilter createQueryFilter()
@Deprecated public static QueryFilter getQueryFilter(Object value)
QueryFilter for a given search value.
The condition for the returned instance is Condition.EQ.
This method is suitable for creating query filters for defined by the application developer "findByXXX" methods
but not for the findByMultipleParameters method. For the latter you can use
#createFilter(String attributePath, String condition, Object value) or
createFilterForBetween(String attributeSpec, Object valueLow, Object valueHigh).
This method is deprecated, use createFilter(Object) instead.
value - the following values have some special semantics:
null - the search clause will be "IS NULL" String - the '*' char is treated as a wildcard chararacter.
If an empty string is supplied then the return filter will be a fake filter (no constraints will be imposed by it).
QueryFilter instance to represent an equality constraint for the given valueCondition
public static QueryFilter createFilterForBetween(Object valueLow,
Object valueHigh)
QueryFilter for searching in a range.
valueLow - the start of the search rangevalueHigh - the end of the search range
QueryFilter instance for the given parameters
@Deprecated
public static QueryFilter createFilter(Object value,
Condition condition)
QueryFilter with a given condition.
This method is deprecated because of inconsistent order of parameters with
createFilter(String, Condition, Object), use createFilter(Condition, Object) instead.
value - the search valuecondition - a value from the Condition enumeration
QueryFilter instance for the given parameters
public static QueryFilter createFilter(Condition condition,
Object value)
QueryFilter with a given condition.
condition - a value from the Condition enumerationvalue - the search value
QueryFilter instance for the given parameterspublic static QueryFilter createFilter(Object value)
QueryFilter for a given search value.
The condition for the returned instance is Condition.EQ.
This method is suitable for creating query filters for defined by the application developer "findByXXX" methods
but not for the findByMultipleParameters method. For the latter you can use
#createFilter(String attributePath, String condition, Object value) or
createFilterForBetween(String attributeSpec, Object valueLow, Object valueHigh).
value - the following values have some special semantics:
null - the search clause will be "IS NULL" StringThe '*' char is treated as a wildcard chararacter.
If an empty string is supplied then the return filter will be a fake filter (no constraints will be imposed by it).
QueryFilter instance to represent an equality constraint for the given valueCondition}
@Deprecated
public static QueryFilter createNumericFilter(Condition condition,
int value,
String name,
boolean bAttribute)
QueryFilter for searching in a TREX system. It cannot be used for local persistency queries.
condition - the condition for this filter; see the constants QueryFilter.CONDITION_* for the possible valuesvalue - the search valuename - the name of the attribute or category; complex attributes have to be named like "name_of_comlex_attribute.name_of_attribute"bAttribute - true if name is an attribute, false if it is a category
QueryFilter instance for the given parameters
@Deprecated
public static QueryFilter createStringFilter(String action,
String value,
String name,
boolean bAttribute)
QueryFilter for searching in a TREX system. It cannot be used for local persistency queries.
There are several opportunities for the type of the search: an exact search, a wilcard search or a fuzzy search.
action - the type of the search that should be performed; see the constants QueryFilter.ACTION_* for the possible valuesvalue - the search value; may contain wildcards (for all the possible values, please check the TREX documentation)name - the name of the attribute or category; complex attributes have to be named like "name_of_comlex_attribute.name_of_attribute"bAttribute - true if name is an attribute, false if it is a category
QueryFilter instance for the given parameters
@Deprecated
public static QueryFilter createFreetextFilter(String action,
String value)
QueryFilter for searching in a TREX system. It cannot be used for local persistency queries.
The created query filter will be used to perform a freetext search over all of the attributes of a BO Node.
action - the type of the search that should be performed; see the constants QueryFilter.ACTION_* for the possible valuesvalue - the search value; may contain wildcards (for all the possible values, please check the TREX documentation)
QueryFilter instance for the given parameters
@Deprecated
public static QueryFilter createDateFilter(Condition condition,
Date value,
String name)
QueryFilter for searching in a TREX system. It cannot be used for local persistency queries.
This method is used to create a filter on a numeric attribute or a category of a BO Node. For expressions on date
attributes you have to keep in mind that a java.util.Date represents a timestamp which is a time measured in milliseconds.
So, for example, if you want to search for objects that have been created at a specific day, you have to define a query which
contains two date filters that are combined by an AND-operator. The first timestamp points to the day you want to search for at 0:00 AM.
The second timestamp represents 0:00 AM at the next day.
condition - a value from the Condition enumerationvalue - the search date valuename - the name of the attribute or category
QueryFilter instance for the given parameters@Deprecated public static QueryFilter createBracket(String type)
findByMultipleParameters method.
You may use QueryFilter.OPEN_BRACKET and QueryFilter.CLOSE_BRACKET instead of this method.
type - the type of the bracket; see the constants QueryFilter.OPERATION_BRACKET_* for the possible values
QueryFilter instance for the given parameters@Deprecated public static QueryFilter createBoolOperator(String type)
QueryFilter.AND, QueryFilter.OR and QueryFilter.NOT instead of this method.
type - the type of the operator; see the constants QueryFilter.OPERATION_* for the possible values
QueryFilter instance for the given parameters
public static QueryFilter createFilter(String attributeSpec,
Condition condition,
Object value)
QueryFilter suitable for the findByMultipleParameters operation.
attributeSpec - This is the full path of the queried attribute. The attribute path is a sequence of attribute names of BO Nodes
or complex structures, separated by BO_NODE_REFERENCE_PATH_SEPARATOR or NESTED_STRUCTURE_PATH_SEPARATOR.
Complex structure "Address" with fields:
"country" : STRING
"streetName" : STRING
BO Nodes:
BO: Department with field:
"name" : STRING
BO: Employee with fields:
"firstName" : STRING
"lastName" : STRING
"address" : Address
Associations:
"employees" - unidirectional one-to-many association from Department to Employee
The following attribute paths can be formed for the BO Node Department (meaning that the query will search for Departments
while satisfying the search conditions):condition - a value from the Condition enumerationvalue - the search value
QueryFilter instance for the given parameters
public static QueryFilter createFilterForBetween(String attributeSpec,
Object valueLow,
Object valueHigh)
QueryFilter for searching in a range.
attributeSpec - see createFilter(String, Condition, Object) for more informationvalueLow - the start of the search rangevalueHigh - the end of the search range
QueryFilter instance for the given parameterscreateFilter(String, Condition, Object)public static Object nullToWildcard(Object value)
|
SAP NetWeaver 7.11 (EhP1 SP03) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||