Package adipe.translate.ra

Examples of adipe.translate.ra.Schema

            public void run() {
                /* translating the first query, then writing the first spreadsheet file take longer time, so let's
                 * warm up here */
                Schema schema = Schemas.fromDDL(DEFAULT_SCHEMA_TEXT);
                try {
                    Term translated = Queries.getRaOf(schema, DEFAULT_QUERY_TEXT);
                    Result result = translated.execute();
                    try (OutputStream os = new OutputStream() {
View Full Code Here

        boolean includeOpenOption0;

        try {
            final String createTableStatements  = schemaTextArea.getText();
            String sqlSource              = queryTextArea.getText();
            final Schema databaseSchema = Schemas.fromDDL(createTableStatements);
            // TODO show a meaningful error message if syntax error in the CREATE TABLE statement, e.g.,
            // duplicate table names
            // TODO show a meaningful error message if the CREATE TABLE statements are broken
            // TODO extract the code that parses the schema and the query from the two translateAnd* functions
            List<String> queries          = Lists.newArrayList();
            List<Term> formulas           = Lists.newArrayList();
            List<Term> inputTables        = Lists.newArrayList();
            final List<Result> results    = Lists.newArrayList();

            declareTablesThenTranslate(sqlSource, databaseSchema, queries, formulas, inputTables);

            Iterator<String> tableNamesIter = databaseSchema.tableNames().iterator();
            for (Term inputTable : inputTables) {
                // add input tables to {@link results} so that they get borders
                // also add labels with column names
                // TODO refactor this and move to QuietSpreadsheetLayout
                Result result = inputTable.execute();
                ColumnLabels labels = result.getLabels();
                String tableName =;
                ColumnNamesImpl cn = databaseSchema.schemaTable(tableName);
                ColumnIndexesImpl ci = cn.asColumnIndexesLookup();
                Iterator<SimpleColumn> scs = ci.iterator();
                for (Column c : result.getResultRelation()) {
                    SimpleColumn sc =;
                    labels.put(c, tableName+".";
View Full Code Here


    private void translateAndShowInAlgebraResultsDialog(String createTableStatements, String sqlSource) {
        Schema databaseSchema = null;
        String resultsText = null;

        try {
            databaseSchema = Schemas.fromDDL(createTableStatements);
        } catch (Exception e) {
View Full Code Here

        return new NamedColumn(new SimpleColumn(type, name),name.toLowerCase());

    private static void givenDdlExpectTablesAndColumns(String ddlStatement, String tableName, NamedColumn... expectedColumns)
        Schema s = Schemas.fromDDL(ddlStatement);


View Full Code Here


Related Classes of adipe.translate.ra.Schema

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