Package adipe.translate

Examples of adipe.translate.TranslationException


                                   Map<String, ArrayList<Type>> columnTypes)
        throws TranslationException {
            try {
                return Schema.create(columnNames, columnTypes);
            } catch (RuntimeException ex) {
                throw new TranslationException(ex);
            }
        }
View Full Code Here


        Relation r;
        ColumnNamesImpl[] colNamesWr = new ColumnNamesImpl[1];
        try {
            r = schema.instantiateTable(primaryName, knownAs, derivedColumnList, colNamesWr);
        } catch (IllegalStateException exc) {
            throw new TranslationException(exc.getMessage(), exc);
        }
        registerRelation(r.alias(), colNamesWr[0]);
        return makeState2(r, colNamesWr[0].asColumnIndexesLookup(), addQualifiedColumnNames(knownAs == null?primaryName:knownAs, colNamesWr[0]));
    }
View Full Code Here

        havingClause = ctx.tableExpression().havingClause();


        if (groupByClause != null && isSelectAsterisk) {
            /* SELECT * FROM.. GROUP BY.. */
            throw new TranslationException("a query cannot have the form of 'SELECT * ... GROUP BY'");
        }
        if (havingClause != null && isSelectAsterisk) {
            /* SELECT * FROM.. HAVING.. */
            throw new TranslationException("a query cannot have the form of 'SELECT * ... HAVING'");
        }

        List<SimpleColumn> groupByExpressions = null;
        if (groupByClause != null) {
            groupByExpressions = Lists.newArrayList(visitGroupByClause(groupByClause));
View Full Code Here

     * @param columnNo  counting from 1
     * @throws TranslationException
     */
    public Relation orderBy(int columnNo, boolean asc) throws TranslationException {
        if (columnNo == 0) {
            throw new TranslationException("ORDER BY 0");
        }
        if (columnNo < 0) {
            throw new TranslationException("wrong sort key");
        }
        if (columnNo > this.columns().size()) {
            throw new TranslationException(String.format("ORDER BY %s, while there are only %s columns", columnNo, this.columns().size()));
        }
        checkArgument(columnNo <= this.columns().size());
        if (asc) {
            return makeNew(Utils.sortAsc(this.formula(), columnNo), this.columns(), this.expandedColumns());
        } else {
View Full Code Here

            Term t = formulas.remove(0);
            inputTables.add(t);
        }

        if (formulas.isEmpty()) {
            throw new TranslationException("An empty string was input as a query");
        }
    }
View Full Code Here

TOP

Related Classes of adipe.translate.TranslationException

Copyright © 2018 www.massapicom. 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.