Package org.apache.ws.jaxme.sqls

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


        }
        sb.append(getColumnAlias(pData, column));
      } while (columnIter.hasNext());
    }

    SelectTableReference selectTableReference = pQuery.getSelectTableReference();
    List whereClauses = new ArrayList();
    if (selectTableReference != null) {
      sb.append(" FROM ");
      sb.append(getTableAlias(selectTableReference));
      for (JoinReference joinReference = selectTableReference.getRightJoinedTableReference();
           joinReference != null;
           joinReference = joinReference.getRightJoinedTableReference()) {
        sb.append(", ");
        sb.append(getTableAlias(joinReference));
        OraJoinReferenceImpl oraJoin = null;
View Full Code Here


   */
  public void testJoin() {
     Table table = getPrimaryKeyTable();
     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();
     bc.addPart(tableReference.newColumnReference("MyIndex"));
     bc.addPlaceholder();

     SQLGenerator generator = getSQLGenerator();
     generator.setLineTerminator("\n");
     String got = generator.getQuery(statement);
View Full Code Here

   */
  public void testLeftOuterJoin() {
     Table table = getPrimaryKeyTable();
     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();
     bc.addPart(tableReference.newColumnReference("MyIndex"));
     bc.addPlaceholder();

     SQLGenerator generator = getSQLGenerator();
     generator.setLineTerminator("\n");
     String got = generator.getQuery(statement);
View Full Code Here

   */
  public void testExists() {
    Table table = getPrimaryKeyTable();
    Table otherTable = getForeignKeyTable(table);
    SelectStatement statement = table.getSelectStatement();
    SelectTableReference tableReference = statement.getSelectTableReference();
    SelectStatement existsStatement = otherTable.getSelectStatement();
    SelectTableReference existsTableReference = existsStatement.getSelectTableReference();
    BooleanConstraint bc = existsStatement.getWhere().createEQ();
    bc.addPart(existsTableReference.newColumnReference("RefIndex"));
    bc.addPart(tableReference.newColumnReference("MyIndex"));
    statement.getWhere().createEXISTS(existsStatement);
  
    SQLGenerator generator = getSQLGenerator();
    generator.setLineTerminator("\n");
View Full Code Here

        }
        sb.append(getColumnAlias(pData, column));
      } while (columnIter.hasNext());
    }

    SelectTableReference selectTableReference = pQuery.getSelectTableReference();
    if (selectTableReference != null) {
      sb.append(" FROM ");
      sb.append(getTableAlias(selectTableReference));
      for (JoinReference joinReference = selectTableReference.getRightJoinedTableReference();
           joinReference != null;
           joinReference = joinReference.getRightJoinedTableReference()) {
        sb.append(getJoinAlias(pData, joinReference));              
      }
    }
View Full Code Here

TOP

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

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.