Skip Headers

# Making a User-Defined Function Available to All Platforms

Previous

Next

To make the function available to all platforms, use `ExpressionOperator` method `addOperator` as Example: Adding a toUpper Function for All Platforms shows.

Adding a toUpper Function for All Platforms

    ExpressionOperator toUpper = new ExpressionOperator();
    toUpper.setSelector(600);
    Vector v = new Vector();
    v.addElement("NUPPER(");
    v.addElement(")");
    toUpper.printAs(v);
    toUpper.bePrefix();
    toUpper.setNodeClass(FunctionExpression.class);

    ExpressionOperator.addOperator(toUpper);

Note: Represent the number in the `setSelector` method by a constant value. Ensure that this number is greater than 500 (numbers below 500 are reserved in TopLink).