Package org.apache.openjpa.jdbc.sql

Examples of org.apache.openjpa.jdbc.sql.DBDictionary.assertSupport()


    public void appendTo(Select sel, ExpContext ctx, ExpState state,
        SQLBuffer buf, int index) {

        DBDictionary dict = ctx.store.getDBDictionary();
        String func = dict.toUpperCaseFunction;
        dict.assertSupport(func != null, "ToUpperCaseFunction");
        if (getValue() instanceof PCPath) {
            func = dict.getCastFunction(getValue(), func, ((PCPath) getValue()).getFieldMapping(state).getColumns()[0]);
        } else {
            func = dict.getCastFunction(getValue(), func);
        }
View Full Code Here


        SQLBuffer sql, int index) {
        DBDictionary dict = ctx.store.getDBDictionary();
        String func;
        if (_where == null) {
            func = dict.trimBothFunction;
            dict.assertSupport(func != null, "TrimBothFunction");
        } else if (_where.booleanValue()) {
            func = dict.trimLeadingFunction;
            dict.assertSupport(func != null, "TrimLeadingFunction");
        } else {
            func = dict.trimTrailingFunction;
View Full Code Here

        if (_where == null) {
            func = dict.trimBothFunction;
            dict.assertSupport(func != null, "TrimBothFunction");
        } else if (_where.booleanValue()) {
            func = dict.trimLeadingFunction;
            dict.assertSupport(func != null, "TrimLeadingFunction");
        } else {
            func = dict.trimTrailingFunction;
            dict.assertSupport(func != null, "TrimTrailingFunction");
        }       
        func = dict.getCastFunction(_val, func);
View Full Code Here

        } else if (_where.booleanValue()) {
            func = dict.trimLeadingFunction;
            dict.assertSupport(func != null, "TrimLeadingFunction");
        } else {
            func = dict.trimTrailingFunction;
            dict.assertSupport(func != null, "TrimTrailingFunction");
        }       
        func = dict.getCastFunction(_val, func);
       
        int fromPart = func.indexOf("{0}");
        int charPart = func.indexOf("{1}");
View Full Code Here

            // where to specify the trim char (denoted by "{1}"),
            // we do not have the ability to trim off non-whitespace
            // characters; throw an exception when we attempt to do so
            if (!(_trimChar instanceof Const) || String.valueOf(((Const)
                _trimChar).getValue(ctx,tstate.charState)).trim().length() != 0)
                dict.assertSupport(false, "TrimNonWhitespaceCharacters");
        }
    }

    public void acceptVisit(ExpressionVisitor visitor) {
        visitor.enter(this);
View Full Code Here

    protected abstract ForeignKey getJoinForeignKey();

    public void appendSize(SQLBuffer sql, Select sel, Joins joins) {
        DBDictionary dict = field.getMappingRepository().getDBDictionary();
        dict.assertSupport(dict.supportsSubselect, "SupportsSubselect");

        ClassMapping[] ind = getIndependentElementMappings(false);
        if (ind != null && ind.length > 1)
            throw RelationStrategies.unjoinable(field);
View Full Code Here

    }

    public void appendTo(Select sel, ExpContext ctx, ExpState state,
        SQLBuffer buf) {
        DBDictionary dict = ctx.store.getDBDictionary();
        dict.assertSupport(dict.supportsSubselect, "SupportsSubselect");

        Select sub = ctx.store.getSQLFactory().newSelect();
        sub.setParent(sel, null);
        // this subselect has the same context as its parent
        sub.setContext(sel.ctx());
View Full Code Here

     * for this relation.
     */
    private void testInverseNull(SQLBuffer sql, Select sel, Joins joins,
        boolean empty) {
        DBDictionary dict = field.getMappingRepository().getDBDictionary();
        dict.assertSupport(dict.supportsSubselect, "SupportsSubselect");

        if (field.getIndependentTypeMappings().length != 1)
            throw RelationStrategies.uninversable(field);

        if (empty)
View Full Code Here

                boolean candidate = ProjectionExpressionVisitor.
                    hasCandidateProjections(exps.projections);
                if (agg || (candidate
                    && (exps.distinct & exps.DISTINCT_TRUE) == 0)) {
                    DBDictionary dict = ctx.store.getDBDictionary();
                    dict.assertSupport(dict.supportsSubselect,
                        "SupportsSubselect");

                    Select inner = sel;
                    sel = ctx.store.getSQLFactory().newSelect();
                    sel.setParent(parent, alias);
View Full Code Here

                post = func.substring(idx + 3);
            }

            // if we can't use LIKE, we have to take the substring of the
            // first value and compare it to the second
            dict.assertSupport(pre != null, "StringLengthFunction");
            dict.substring(buf,
                new FilterValueImpl(sel, ctx, bstate.state1, _val1),
                new ZeroFilterValue(sel, state),
                new StringLengthFilterValue(sel, ctx, bstate.state2, pre,post));
            buf.append(" = ");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.