if (targetStreamNum == parameterStreamNum) {
return;
}
ExprIdentNode targetStartExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, targetStreamNum, targetStartProp);
ExprIdentNode targetEndExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, targetStreamNum, targetEndProp);
ExprIdentNode parameterStartExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, parameterStreamNum, parameterStartProp);
ExprIdentNode parameterEndExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, parameterStreamNum, parameterEndProp);
if (targetStartExpr.getExprEvaluator().getType() != parameterStartExpr.getExprEvaluator().getType()) {
return;
}
if (currentMethod == DatetimeMethodEnum.BEFORE) {
// a.end < b.start
queryGraph.addRelationalOpStrict(targetStreamNum, targetEndProp, targetEndExpr,
parameterStreamNum, parameterStartProp, parameterStartExpr,
RelationalOpEnum.LT);
}
else if (currentMethod == DatetimeMethodEnum.AFTER) {
// a.start > b.end
queryGraph.addRelationalOpStrict(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterEndProp, parameterEndExpr,
RelationalOpEnum.GT);
}
else if (currentMethod == DatetimeMethodEnum.COINCIDES) {
// a.startTimestamp = b.startTimestamp and a.endTimestamp = b.endTimestamp
queryGraph.addStrictEquals(targetStreamNum, targetStartProp, targetStartExpr,
parameterStreamNum, parameterStartProp, parameterStartExpr);
boolean noDuration = parameterEndProp.equals(parameterStartProp) && targetEndProp.equals(targetStartProp);
if (!noDuration) {
ExprIdentNode leftEndExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, targetStreamNum, targetEndProp);
ExprIdentNode rightEndExpr = ExprNodeUtility.getExprIdentNode(typesPerStream, parameterStreamNum, parameterEndProp);
queryGraph.addStrictEquals(targetStreamNum, targetEndProp, leftEndExpr,
parameterStreamNum, parameterEndProp, rightEndExpr);
}
}
else if (currentMethod == DatetimeMethodEnum.DURING || currentMethod == DatetimeMethodEnum.INCLUDES) {