Package org.apache.ws.jaxme.sqls

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


      }
      return newColumnReference(column);
  }

  public ColumnReference newColumnReference(Column pColumn) {
      ColumnReference columnReference = getStatement().getSQLFactory().getObjectFactory().newColumnReference(this, pColumn);
      columnReferences.add(columnReference);
      return columnReference;
  }
View Full Code Here


    }

    public Iterator getColumns() {
        List result = new ArrayList();
        for (Iterator iter = stmt.getResultColumns();  iter.hasNext()) {
            ColumnReference col = (ColumnReference) iter.next();
            result.add(new ViewColumnImpl(col));
        }
        return result.iterator();
    }
View Full Code Here

    public Column getColumn(Column.Name pName) {
        if (pName == null) {
            throw new NullPointerException("Column names must not be null.");
         }
        for (Iterator iter = stmt.getResultColumns();  iter.hasNext()) {
            ColumnReference col = (ColumnReference) iter.next();
            Column.Name alias = col.getAlias();
            if (alias == null) {
              alias = col.getColumn().getName();
            }
            if (alias.equals(pName)) {
                return new ViewColumnImpl(col);
            }
        }
View Full Code Here

        if (subSelect == null) {
            return getSetStatementsColumns(pStatement);
        } else {
          List result = new ArrayList();
            for (Iterator iter = subSelect.getResultColumns();  iter.hasNext()) {
            ColumnReference cRef = (ColumnReference) iter.next();
            Column.Name name;
            if (cRef.getAlias() == null) {
                    name = cRef.getColumn().getName();
            } else {
                    name = cRef.getAlias();
            }
            Column col = pStatement.getTableReference().getTable().getColumn(name);
            if (col == null) {
              throw new IllegalStateException("A result column " + name
                  + " is used in the subselect, which is not present in the insert statements table.");
View Full Code Here

        if (!columnIter.hasNext()) {
            sb.append(" *");
        } else {
            boolean first = true;
            do {
                ColumnReference column = (ColumnReference) columnIter.next();
                if (first) {
                    sb.append(" ");
                    first = false;
                } else {
                    sb.append(", ");
View Full Code Here

            for (Iterator iter = source.getParts();  iter.hasNext()) {
                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

   public boolean equals(Object o) {
      if (o == null  ||  !(o instanceof ColumnReference)) {
         return false;
      }
      ColumnReference ref = (ColumnReference) o;
    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

    if (!columnIter.hasNext()) {
      sb.append(" *");
    } else {
      boolean first = true;
      do {
        ColumnReference column = (ColumnReference) columnIter.next();
        if (first) {
          sb.append(" ");
          first = false;
        } else {
          sb.append(", ");
View Full Code Here

      for (Iterator iter = source.getParts();  iter.hasNext()) {
        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

    if (!columnIter.hasNext()) {
      sb.append(" *");
    } else {
      boolean first = true;
      do {
        ColumnReference column = (ColumnReference) columnIter.next();
        if (first) {
          sb.append(" ");
          first = false;
        } else {
          sb.append(", ");
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.ColumnReference

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.