Package com.im.df.api.dml
Class DFTermsFactory
- java.lang.Object
-
- com.im.df.api.dml.DFTermsFactory
-
public final class DFTermsFactory extends java.lang.Object
The factory class for creatingDFTerm
s. This class has only limited methods which creates only expression of some specific patterns which are currently supported by DIF execution. So it's not possible to createDFTermExpression
which DIF implementation is not able to execute.It's very likely that this class will contain more create methods in the future.
- Author:
- Petr Hamernik
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DFTermExpression
createCountStarExpr(DFRelationship.Direction[] pathFromRoot, DFOperator operator, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... values)
static DFTermExpression
createExprAndOr(DFOperator operator, java.util.List<DFTermExpression> childExpressions, java.util.Map<java.lang.String,java.lang.Object> options)
Creates the AND or OR expression (e.g.static DFTermExpression
createFieldOperatorValueExpr(DFOperator operator, DFField field, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... values)
Create the basic "Field operator Value(s)" expression.static DFTermExpression
mergeDomainFilterWithExpression(DFTermExpression expr, DFSearchDomain domain)
When DFSearchDomain is used this method adds a new IN LIST expression with domain's ids to given expression set.
-
-
-
Method Detail
-
createFieldOperatorValueExpr
public static DFTermExpression createFieldOperatorValueExpr(DFOperator operator, DFField field, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... values)
Create the basic "Field operator Value(s)" expression. The number of values depends on the type of operator you use. Some operators are unary (accepts only one operand which is the field... e.g. NULL operator), some other are binary (less than,...) and some accepts many operands (e.g. IN LIST).- Parameters:
operator
- The operatorfield
- The field (will be used as the first operand)options
- Options of the expression, can benull
(emptyMap
is created then)values
- Constant values - the number should match with the operator arity.- Returns:
- The new expression term based on the given arguments. Never returns
null
.
-
createCountStarExpr
public static DFTermExpression createCountStarExpr(DFRelationship.Direction[] pathFromRoot, DFOperator operator, java.util.Map<java.lang.String,java.lang.Object> options, java.lang.Object... values)
-
createExprAndOr
public static DFTermExpression createExprAndOr(DFOperator operator, java.util.List<DFTermExpression> childExpressions, java.util.Map<java.lang.String,java.lang.Object> options)
Creates the AND or OR expression (e.g. (id = 5) OR (atomcount = 10))- Parameters:
operator
- Operator for this expression. Only allowed values areOperators.AND
andOperators.OR
. You can useOperators.isAndOr(DFOperator)
method to test your operator. If other operator is specified this method throws IllegalArgumentException.childExpressions
- One or more child expressions. Currently accepts only DFTermExpressions.options
- Options of the expression- Returns:
- The new AND/OR expression term based on the given arguments. Never returns null.
-
mergeDomainFilterWithExpression
public static DFTermExpression mergeDomainFilterWithExpression(DFTermExpression expr, DFSearchDomain domain)
When DFSearchDomain is used this method adds a new IN LIST expression with domain's ids to given expression set.- Parameters:
expr
- Original expressiondomain
- Original search domain- Returns:
- New merged DFTermExpression
-
-