Package com.im.df.api.dml
Class DFTermExpressions
- java.lang.Object
-
- com.im.df.api.dml.DFTermExpressions
-
public final class DFTermExpressions extends java.lang.Object
Utility class forDFTermExpression
.- Since:
- 17.1.9
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FILTER_CHILD_DATA
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends DFTerm>
java.util.List<T>filterOperands(DFTermExpression expr, java.lang.Class<T> clazz)
Returns the list operands with defined type.static DFEntity
getEntity(DFTermExpression expr)
Extracts entity from expression.static DFField
getField(DFTermExpression expr)
Extracts field from expression.static java.util.List<java.lang.Object>
getValues(DFTermExpression expr)
Returns the values from the expression.static java.util.List<java.lang.Object>
getValues(DFTermExpression expr, DFDataConvertor convertor)
Returns the values from the expression converted with theconvertor
.static boolean
isCountStar(DFTermExpression expr)
Returns if the expression is COUNT(*).static boolean
isFilterChildData(DFTermExpression query, DFDataTree dataTree)
Tells if filtering child data feature is on or off for given query.static boolean
isLoadAllConvergentData(DFTermExpression query, DFDataTree dataTree)
Tells if loading all convergent child data feature is on or off for given query.static boolean
isLogical(DFTermExpression expr)
Returns if the expression is logical.static DFTermExpression
putOptions(DFTermExpression query, java.util.Map<java.lang.String,java.lang.Object> options)
Adds given options to the given query.static DFTermExpression
setFilterChildData(DFTermExpression query, boolean filterChildData)
Sets filtering of child data for given query.static DFTermExpression
setLoadAllConvergentData(DFTermExpression query, boolean loadAllConvergentData)
Sets loading of all convergent child data for given query.
-
-
-
Field Detail
-
FILTER_CHILD_DATA
public static final java.lang.String FILTER_CHILD_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getField
public static DFField getField(DFTermExpression expr)
Extracts field from expression.- Parameters:
expr
- The expression.- Returns:
- The field used in expression, can be null.
-
getEntity
public static DFEntity getEntity(DFTermExpression expr)
Extracts entity from expression.- Parameters:
expr
- The expression.- Returns:
- The entity used in expression, can be null.
-
filterOperands
public static <T extends DFTerm> java.util.List<T> filterOperands(DFTermExpression expr, java.lang.Class<T> clazz)
Returns the list operands with defined type.- Type Parameters:
T
- The type of operands.- Parameters:
expr
- The expression.clazz
- The class to return.- Returns:
- List of operands with the defined type.
-
getValues
public static java.util.List<java.lang.Object> getValues(DFTermExpression expr)
Returns the values from the expression.- Parameters:
expr
- The expression.- Returns:
- List of values defined in expression.
-
getValues
public static java.util.List<java.lang.Object> getValues(DFTermExpression expr, DFDataConvertor convertor)
Returns the values from the expression converted with theconvertor
.- Parameters:
expr
- The expression.convertor
- Convertor used to convert the data.- Returns:
- List of values defined in expression.
-
isLogical
public static boolean isLogical(DFTermExpression expr)
Returns if the expression is logical.- Parameters:
expr
- The expression- Returns:
- True if the operator used in expression is logical (AND or OR).
-
isCountStar
public static boolean isCountStar(DFTermExpression expr)
Returns if the expression is COUNT(*).- Parameters:
expr
- The expression.- Returns:
- True if the expression is COUNT(*).
-
isFilterChildData
public static boolean isFilterChildData(DFTermExpression query, DFDataTree dataTree)
Tells if filtering child data feature is on or off for given query.- Parameters:
query
- the querydataTree
- the data tree where the query belongs- Returns:
true
if filtering is enabled on the given query.- Since:
- 19.20.0
- See Also:
DFResultSet.isFilterSearchResults()
-
isLoadAllConvergentData
public static boolean isLoadAllConvergentData(DFTermExpression query, DFDataTree dataTree)
Tells if loading all convergent child data feature is on or off for given query.- Parameters:
query
- the querydataTree
- the data tree where the query belongs- Returns:
true
if loading is enabled on the given query.- Since:
- 19.20.0
- See Also:
DFResultSet.isLoadAllChildRows()
-
setFilterChildData
public static DFTermExpression setFilterChildData(DFTermExpression query, boolean filterChildData)
Sets filtering of child data for given query. See documentation.- Parameters:
query
- the queryfilterChildData
-true
means filtering is on,false
means off- Returns:
- changed query
- Since:
- 19.20.0
- See Also:
DFResultSet.enableFilterSearchResults(boolean, com.im.commons.progress.DFEnvironmentRW)
-
setLoadAllConvergentData
public static DFTermExpression setLoadAllConvergentData(DFTermExpression query, boolean loadAllConvergentData)
Sets loading of all convergent child data for given query. See documentation.- Parameters:
query
- the queryloadAllConvergentData
-true
means loading is on,false
means off- Returns:
- changed query
- Since:
- 19.20.0
- See Also:
DFResultSet.setLoadAllChildRows(boolean, com.im.commons.progress.DFEnvironmentRW)
-
putOptions
public static DFTermExpression putOptions(DFTermExpression query, java.util.Map<java.lang.String,java.lang.Object> options)
Adds given options to the given query. If an option already exists, it is overwritten.- Parameters:
query
- the queryoptions
- new options to add or overwrite- Returns:
- changed query
- Since:
- 19.20.0
-
-