Package org.apache.ws.jaxme.sqls.oracle

Examples of org.apache.ws.jaxme.sqls.oracle.OraSelectStatement


        return "SELECT OtherTable.MyIndex, RefIndex, Company FROM MySchema.OtherTable, MySchema.MyTable WHERE RefIndex=MyTable.MyIndex(+) AND OtherTable.MyIndex=?";
    }

    public void testConnectByPrior() {
        Table table = getBasicTable();
        OraSelectStatement selectStatement = (OraSelectStatement) table.getSelectStatement();
        SelectTableReference ref = selectStatement.getSelectTableReference();
        CombinedConstraint startWith = selectStatement.getStartWith();
        BooleanConstraint bc = startWith.createEQ();
        bc.addPart(ref.newColumnReference("MyIndex"));
        bc.addPart(1);
        CombinedConstraint connectByPrior = selectStatement.getConnectByPrior();
        bc = connectByPrior.createEQ();
        bc.addPart(ref.newColumnReference("MyIndex"));
        bc.addPart(ref.newColumnReference("MyName"));
        SQLGenerator gen = getSQLGenerator();
        String query = gen.getQuery(selectStatement);
View Full Code Here


        return "SELECT OtherTable.MyIndex, RefIndex, Company FROM MySchema.OtherTable, MySchema.MyTable WHERE RefIndex=MyTable.MyIndex(+) AND OtherTable.MyIndex=?";
    }

    public void testConnectByPrior() {
        Table table = getBasicTable();
        OraSelectStatement selectStatement = (OraSelectStatement) table.getSelectStatement();
        SelectTableReference ref = selectStatement.getSelectTableReference();
        CombinedConstraint startWith = selectStatement.getStartWith();
        BooleanConstraint bc = startWith.createEQ();
        bc.addPart(ref.newColumnReference("MyIndex"));
        bc.addPart(1);
        CombinedConstraint connectByPrior = selectStatement.getConnectBy();
        bc = connectByPrior.createEQ();
        OraColumnReference oraRef = (OraColumnReference) ref.newColumnReference("MyIndex");
        oraRef.setPrior(true);
        bc.addPart(oraRef);
        bc.addPart(ref.newColumnReference("MyName"));
View Full Code Here

     *    )
     *    CONNECT BY PRIOR KE.AID=KE.AVERTRETERID
     * </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")));

View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.oracle.OraSelectStatement

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.