/** * ExpressionOperator for the MDSYS.SDO_WITHIN_DISTANCE Spatial Operator on the Oracle Database * Use of this operator requires the Java spatial classes * * @return */ public static ExpressionOperator withinDistance() { ExpressionOperator operator = ExpressionOperator.simpleThreeArgumentFunction( SDO_WITHIN_DISTANCE, "MDSYS.SDO_WITHIN_DISTANCE"); operator.bePrefix(); return operator; }
/** INTERNAL: Build locate operator i.e. LOCATE("ob", t0.F_NAME) */ public static ExpressionOperator createLocateOperator() { ExpressionOperator expOperator = ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Locate, "INSTR"); int[] argumentIndices = new int[2]; argumentIndices[0] = 0; argumentIndices[1] = 1; expOperator.setArgumentIndices(argumentIndices); expOperator.setIsBindingSupported(false); return expOperator; }
/** Create the log operator for this platform */ private static final ExpressionOperator createLogOperator() { ExpressionOperator result = new ExpressionOperator(); result.setSelector(ExpressionOperator.Log); Vector v = NonSynchronizedVector.newInstance(2); v.addElement("LOG(10,"); v.addElement(")"); result.printsAs(v); result.bePrefix(); result.setNodeClass(FunctionExpression.class); return result; }
private static final ExpressionOperator createNullifOperator() { ExpressionOperator exOperator = new ExpressionOperator(); exOperator.setType(ExpressionOperator.FunctionOperator); exOperator.setSelector(ExpressionOperator.NullIf); Vector v = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(4); v.addElement(" (CASE WHEN "); v.addElement(" = "); v.addElement(" THEN NULL ELSE "); v.addElement(" END) "); exOperator.printsAs(v); exOperator.bePrefix(); int[] indices = {0, 1, 0}; exOperator.setArgumentIndices(indices); exOperator.setNodeClass(ClassConstants.FunctionExpression_Class); return exOperator; }
/** INTERNAL: Allow the use of XMLType operators on this platform. */ protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.extract()); addOperator(ExpressionOperator.extractValue()); addOperator(ExpressionOperator.existsNode()); addOperator(ExpressionOperator.isFragment()); addOperator(ExpressionOperator.getStringVal()); addOperator(ExpressionOperator.getNumberVal()); addOperator(SpatialExpressionOperators.withinDistance()); addOperator(SpatialExpressionOperators.relate()); addOperator(SpatialExpressionOperators.filter()); addOperator(SpatialExpressionOperators.nearestNeighbor()); }
protected void initializePlatformOperators() { super.initializePlatformOperators(); addOperator(ExpressionOperator.simpleMath(ExpressionOperator.Concat, "||")); }
private void addNonBindingOperator(ExpressionOperator operator) { operator.setIsBindingSupported(false); addOperator(operator); }
private static final ExpressionOperator createNullValueOperator() { return ExpressionOperator.simpleTwoArgumentFunction(ExpressionOperator.Nvl, "IFNULL"); }
/** * Creates the expression operator representing the JPQL function variance * * @return the expression operator representing the JPQL function variance */ private static final ExpressionOperator createVarianceOperator() { return ExpressionOperator.simpleAggregate(ExpressionOperator.Variance, "VAR", "variance"); }
/** * Creates the expression operator representing the JPQL function current_timestamp as defined by * 4.6.17.2.3 of the JPA 2.0 specification * * @return the expression operator representing the JPQL function current_timestamp as defined by * 4.6.17.2.3 of the JPA 2.0 specification */ private static final ExpressionOperator createCurrentTimeExpressionOperator() { return ExpressionOperator.simpleLogicalNoParens(ExpressionOperator.CurrentTime, "CURRENT_TIME"); }
/** * Creates the expression operator representing the JPQL function current_timestamp as defined by * 4.6.17.2.3 of the JPA 2.0 specification * * @return the expression operator representing the JPQL function current_timestamp as defined by * 4.6.17.2.3 of the JPA 2.0 specification */ private static final ExpressionOperator createTodayExpressionOperator() { return ExpressionOperator.simpleLogicalNoParens(ExpressionOperator.Today, "CURRENT_TIMESTAMP"); }
private static final ExpressionOperator createConcatExpressionOperator() { return ExpressionOperator.simpleLogicalNoParens(ExpressionOperator.Concat, "||"); }
/** * ExpressionOperator for the MDSYS.SDO_NN Spatial Operator on the Oracle Database Use of this * operator requires the Java spatial classes * * @return */ public static ExpressionOperator nearestNeighbor() { ExpressionOperator operator = ExpressionOperator.simpleThreeArgumentFunction(SDO_NN, "MDSYS.SDO_NN"); operator.bePrefix(); return operator; }
/** * ExpressionOperator for the MDSYS.SDO_FILTER Spatial Operator on the Oracle Database Use of this * operator requires the Java spatial classes * * @return */ public static ExpressionOperator filter() { ExpressionOperator operator = ExpressionOperator.simpleThreeArgumentFunction(SDO_FILTER, "MDSYS.SDO_FILTER"); operator.bePrefix(); return operator; }
/** * ExpressionOperator for the MDSYS.MDSYS.SDO_RELATE Spatial Operator on the Oracle Database Use * of this operator requires the Java spatial classes * * @return */ public static ExpressionOperator relate() { ExpressionOperator operator = ExpressionOperator.simpleThreeArgumentFunction(SDO_RELATE, "MDSYS.SDO_RELATE"); operator.bePrefix(); return operator; }