Package adipe.translate.sql

Examples of adipe.translate.sql.SimpleColumn


        q2          = schema.schemaTable("xy");
        new_p       = schema.schemaTable("p");
        withAmbiguousColumnNames = schema3.schemaTable("withAmbiguousColumnNames");
        withAliases = new ColumnNamesImpl();
        withAliases.addColumn("alias_r", new SimpleColumn(AnyType.INSTANCE, "r"));

        scope1 = new ColumnScope(null);
        scope2 = new ColumnScope(scope1);

        scope2.addTable("alias_p",  alias_p);
View Full Code Here


            if (bothColumnsFromSameOperand) {
                pIsEq = false;
            } else if (isInnerJoin) {
                index2 = index2 - r1.relation().columns().size();

                SimpleColumn replacedColumn = r2.relation().columns().get(index2 - 1);
                SimpleColumn replacedBy = r1.relation().columns().get(index1 - 1);
                for (ColumnNamesImpl cibn : relationsFound.values()) {
                    // TODO improve time complexity
                    cibn.replace(replacedColumn, replacedBy);
                }
                named.replace(replacedColumn, replacedBy);
View Full Code Here

            private SimpleColumn findColumnInEither(String columnName) throws AmbiguousNameException, WrappedException {
                if (r1.getTableIfQualifiedNameAndExists(columnName) != null && r2.getTableIfQualifiedNameAndExists(columnName) != null) {
                    throw new AmbiguousNameException(String.format("The table name '%s' is ambiguous", TableScope.getTableNameIfQualifiedName(columnName)));
                }

                SimpleColumn matchInLeftState = r1.getColumnIcShdNwrapAmbNindNull(columnName);
                if (matchInLeftState != null) {
                    try {
                        r2.getColumnIcShdNwrapAmbInd(columnName);
                        throw new AmbiguousNameException(String.format("The column name '%s' is ambiguous", columnName));
                    } catch (IndexOutOfBoundsException exc) {
View Full Code Here

    }

    // TODO duplicated getColumnIc methods all over the project
    private SimpleColumn getColumnIcShdNwrapAmbInd(String columnNameIc) throws AmbiguousNameException, IndexOutOfBoundsException {
        checkNotNull(columnNameIc);
        SimpleColumn column = columnScope().getIcNshdNwrapAmbInd(columnNameIc);

        String tableNameIc = TableScope.getTableNameIfQualifiedName(columnNameIc);
        if (tableNameIc != null) {
            String unqualifiedColumnNameIc = TableScope.getUnqualifiedColumnName(columnNameIc);
            ColumnNamesImpl table = tableScope.getIc(tableNameIc);
View Full Code Here

        SortSpecificationContext ssc = sslc.sortSpecification(0);

        boolean asc = ssc.orderingSpecification() == null || ssc.orderingSpecification().ASC() != null;

        if (ssc.sortKey().columnName() != null) {
            SimpleColumn sc = scopeIncludingAliases.getColumnIcShdWrapNambNind(ssc.sortKey().columnName().getText());
            return unordered.orderBy(sc, asc);
        } else {
            int columnNo = visitUnsignedInteger(ssc.sortKey().unsignedInteger());
            return unordered.orderBy(columnNo, asc);
        }
View Full Code Here

        if (columnReference != null) {
            String tableAlias =
                    columnReference.qualifier() == null ? null : columnReference.qualifier().getText();
            String columnName = columnReference.columnName().getText();

            SimpleColumn column;
            if (tableAlias == null) {
                column = ex.byColumnName(columnName);
            } else {
                column = ex.byColumnName(tableAlias + "." + columnName);
            }
View Full Code Here

        String nameCaseSensitive = columnNames.ceilingKey(nameIc);

        for (int i = 0; i < columnNameList.size(); ++i) {
            String columnName = columnNameList.get(i);
            Type columnType = typeList.get(i);
            c.put(columnName.toLowerCase(), new SimpleColumn(columnType, columnName));
        }

        return new ColumnNamesImpl(nameCaseSensitive, c);
    }
View Full Code Here

                String tableName = tableNamesIter.next();
                ColumnNamesImpl cn = databaseSchema.schemaTable(tableName);
                ColumnIndexesImpl ci = cn.asColumnIndexesLookup();
                Iterator<SimpleColumn> scs = ci.iterator();
                for (Column c : result.getResultRelation()) {
                    SimpleColumn sc = scs.next();
                    labels.put(c, tableName+"."+sc.name());
                }

                results.add(result);
            }
View Full Code Here

                if (i + 1 != index2) {
                    attributesOrder.add(that.columns().get(i));
                }
            }

            SimpleColumn replacedColumn = that.columns.get(index2-1);
            SimpleColumn replacedBy = this.columns.get(index1-1);
            attributesOrderInExpanded.replace(replacedColumn, replacedBy);
        }

        return new Relation(namesRelations, null, joined, attributesOrder, attributesOrderInExpanded);
    }
View Full Code Here

                };


    private static NamedColumn col(String name, Type type) {
        return new NamedColumn(new SimpleColumn(type, name),name.toLowerCase());
    }
View Full Code Here

TOP

Related Classes of adipe.translate.sql.SimpleColumn

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.