Package org.apache.ws.jaxme.sqls

Examples of org.apache.ws.jaxme.sqls.BooleanConstraint.addPart()


            throw new IllegalStateException("The statement of the table reference is not the same as this constraints statement.");
        }
        for (Iterator iter = pSet.getColumns();  iter.hasNext()) {
            Column column = (Column) iter.next();
            BooleanConstraint eq = createEQ();
            eq.addPart(new ColumnReferenceImpl(pTableReference, column));
            eq.addPlaceholder();
        }
    }
   
    public void addJoin(ForeignKey pKey, TableReference pReferencingTable,
View Full Code Here


        }
       
        for (Iterator iter = pKey.getColumnLinks();  iter.hasNext()) {
            ForeignKey.ColumnLink columnReference = (ForeignKey.ColumnLink) iter.next();
            BooleanConstraint eq = createEQ();
            eq.addPart(new ColumnReferenceImpl(pReferencingTable, columnReference.getLocalColumn()));
            eq.addPart(new ColumnReferenceImpl(pReferencedTable, columnReference.getReferencedColumn()));
        }
    }
   
    public void addJoin(TableReference pReferencingTable,
View Full Code Here

       
        for (Iterator iter = pKey.getColumnLinks();  iter.hasNext()) {
            ForeignKey.ColumnLink columnReference = (ForeignKey.ColumnLink) iter.next();
            BooleanConstraint eq = createEQ();
            eq.addPart(new ColumnReferenceImpl(pReferencingTable, columnReference.getLocalColumn()));
            eq.addPart(new ColumnReferenceImpl(pReferencedTable, columnReference.getReferencedColumn()));
        }
    }
   
    public void addJoin(TableReference pReferencingTable,
            ColumnSet pReferencingColumnSet,
View Full Code Here

            if (!referencedIter.hasNext()) {
                throw new IllegalStateException("The size of the referencing and referenced column sets doesn't match.");
            }
            Column referencedColumn = (Column) referencedIter.next();
            BooleanConstraint eq = createEQ();
            eq.addPart(pReferencingTable.newColumnReference(referencingColumn));
            eq.addPart(pReferencedTable.newColumnReference(referencedColumn));
        }
    }
   
   
View Full Code Here

                throw new IllegalStateException("The size of the referencing and referenced column sets doesn't match.");
            }
            Column referencedColumn = (Column) referencedIter.next();
            BooleanConstraint eq = createEQ();
            eq.addPart(pReferencingTable.newColumnReference(referencingColumn));
            eq.addPart(pReferencedTable.newColumnReference(referencedColumn));
        }
    }
   
   
    public int getNumParts() {
View Full Code Here

                throw new IllegalArgumentException("Invalid boolean constraint type: " + sourceType);
            }
            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());
View Full Code Here

                    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

       
        joinReference.getOn().addJoin((ForeignKey) otherTable.getForeignKeys().next(),
                refLocal, refRef);
        CombinedConstraint cc = statement.getWhere();
        BooleanConstraint bc = cc.createEQ();
        bc.addPart(tableReference.newColumnReference("MyIndex"));
        bc.addPlaceholder();
        return statement;
    }

    /** <p>Test for a JOIN statement.</p>
View Full Code Here

       
        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

        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

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.