Examples of TableReference


Examples of org.apache.ws.jaxme.sqls.TableReference

   public boolean equals(Object o) {
      if (o == null  ||  !(o instanceof TableReference)) {
         return false;
      }
      TableReference ref = (TableReference) o;
      return ref.getStatement().equals(getStatement())  &&
             ref.getTable().equals(getTable());
   }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

            } else {
                throw new IllegalStateException("Invalid type of VirtualColumn: " + o);
            }
        } else {
            if (isQualifiedColumn(pData, pColumn)) {
                TableReference tableReference = pColumn.getTableReference();
                if (tableReference.getAlias() != null) {
                    s = tableReference.getAlias().getName() + "." + s;
                } else {
                    s = tableReference.getTable().getName() + "." + s;
                }
            }
           
            if (pColumn.getAlias() != null) {
                s = s + " AS " + pColumn.getAlias().getName();
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

        }
    }

    protected void addSelectStatement(SelectStatement pQuery) {
        for (Iterator tableIter = pQuery.getSelectTableReferences();  tableIter.hasNext()) {
            TableReference ref = (TableReference) tableIter.next();
            addTable(ref);
        }
        addCombinedConstraint(pQuery.getWhere());
        for (Iterator iter = pQuery.getResultColumns();  iter.hasNext()) {
            addPart(iter.next());
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

    protected void createTableAliases() {
        if (tables.size() > 1) {
            // Make sure that all tables have an alias
            for (Iterator iter = tables.iterator();  iter.hasNext()) {
                TableReference tableReference = (TableReference) iter.next();
                if (tableReference.getAlias() == null) {
                    String alias = getUniqueAlias(tableReference.getTable().getName().getName(), aliases);
                    aliases.put(alias, tableReference);
                    if (!alias.equals(tableReference.getTable().getName().getName())) {
                        tableReference.setAlias(alias);
                    }
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

      // maps key is the column name, and the maps value is the
      // number of possible references. In other words: If an entry
      // in the map has a value > 1, then its column name must be
      // qualified, because it is used in multiple tables.
      for (int i = 0;  i < tables.size();  i++) {
        TableReference table = (TableReference) tables.get(i);
        for (Iterator iter = table.getTable().getColumns();  iter.hasNext()) {
          Column col = (Column) iter.next();
          addColumnName(col.getName());
        }
      }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

        Table otherTable = getForeignKeyTable(table);
        SelectStatement statement = otherTable.getSelectStatement();
        SelectTableReference tableReference = statement.getSelectTableReference();
        JoinReference joinReference = tableReference.join(table);
       
        TableReference refLocal = tableReference;
        TableReference refRef = tableReference.getRightJoinedTableReference();
       
        joinReference.getOn().addJoin((ForeignKey) otherTable.getForeignKeys().next(),
                refLocal, refRef);
        CombinedConstraint cc = statement.getWhere();
        BooleanConstraint bc = cc.createEQ();
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

        Table otherTable = getForeignKeyTable(table);
        SelectStatement statement = otherTable.getSelectStatement();
        SelectTableReference tableReference = statement.getSelectTableReference();
        JoinReference joinReference = tableReference.leftOuterJoin(table);
       
        TableReference refLocal = tableReference;
        TableReference refRef = tableReference.getRightJoinedTableReference();
       
        joinReference.getOn().addJoin((ForeignKey) otherTable.getForeignKeys().next(),
                refLocal, refRef);
        CombinedConstraint cc = statement.getWhere();
        BooleanConstraint bc = cc.createEQ();
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

                Object o = iter.next();
                if (o instanceof Value) {
                    target.addPart((Value) o);
                } else if (o instanceof ColumnReference) {
                    ColumnReference colRef = (ColumnReference) o;
                    TableReference tableRef = (TableReference) pMap.get(colRef.getTableReference());
                    if (tableRef == null) {
                        throw new IllegalStateException("Unknown reference to table " + colRef.getTableReference().getTable().getQName());
                    }
                    target.addPart(tableRef.newColumnReference(colRef.getColumn()));
                } else {
                    throw new IllegalStateException("Unknown part type: " + o.getClass().getName());
                }
            }
        } else {
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

    Column c1 = ref.getColumn();
    Column c2 = getColumn();
    if (c1 == null  ||  c2 == null) {
      return super.equals(o);
    }
    TableReference t1 = ref.getTableReference();
    TableReference t2 = ref.getTableReference();
    if (t1 == null  ||  t2 == null) {
      return super.equals(o);
    }
      return t1.equals(t2&&  c1.equals(c2);
   }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.TableReference

     * </pre></p>
     */
    private SelectStatement getSelectAllChildsByOrganisationsId() {
        OraSelectStatement stmt = (OraSelectStatement) sqlFactory.newSelectStatement();
        stmt.setTable(kettenElement);
        TableReference tRef  = stmt.getTableReference();

        BooleanConstraint in = stmt.getStartWith().createIN();
        in.addPart(tRef.newColumnReference(kettenElement.getColumn("aId")));
        in.addPart(getSelectAidByOrganisationsId());
       
        BooleanConstraint bc = stmt.getConnectBy().createEQ();
        OraColumnReference ref1 = (OraColumnReference) tRef.newColumnReference(kettenElement.getColumn("aId"));
        ref1.setPrior(true);
        bc.addPart(ref1);
        bc.addPart(tRef.newColumnReference(kettenElement.getColumn("aVertreterId")));

        return stmt;
    }
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.