Package org.apache.ws.jaxme.sqls

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


            throw new IllegalStateException("The statement of the referenced table is not the same as this constraints statement.");
        }
       
        for (Iterator iter = pKey.getColumnLinks();  iter.hasNext()) {
            ForeignKey.ColumnLink columnReference = (ForeignKey.ColumnLink) iter.next();
            BooleanConstraint eq = createEQ();
            ObjectFactory of = getConstrainedStatement().getSQLFactory().getObjectFactory();
            eq.addPart(of.newColumnReference(pReferencingTable, columnReference.getLocalColumn()));
            eq.addPart(of.newColumnReference(pReferencedTable, columnReference.getReferencedColumn()));
        }
    }
View Full Code Here


            Column referencingColumn = (Column) iter.next();
            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

                } else {
                    throw new IllegalArgumentException("Invalid part: " + o.getClass().getName());
                }
            }
        } else if (pConstraint instanceof BooleanConstraint) {
            BooleanConstraint source = (BooleanConstraint) pConstraint;
            BooleanConstraint target;
            BooleanConstraint.Type sourceType = source.getType();
            if (BooleanConstraint.Type.EQ.equals(sourceType)) {
                target = createEQ();
            } else if (BooleanConstraint.Type.NE.equals(sourceType)) {
                target = createNE();
            } else if (BooleanConstraint.Type.GT.equals(sourceType)) {
                target = createGT();
            } else if (BooleanConstraint.Type.LT.equals(sourceType)) {
                target = createLT();
            } else if (BooleanConstraint.Type.GE.equals(sourceType)) {
                target = createGE();
            } else if (BooleanConstraint.Type.LE.equals(sourceType)) {
                target = createLE();
            } else if (BooleanConstraint.Type.LIKE.equals(sourceType)) {
                target = createLIKE();
            else if (BooleanConstraint.Type.ISNULL.equals(sourceType)) {
                target = createISNULL();
            } else if (BooleanConstraint.Type.IN.equals(sourceType)) {
                target = createIN();
            } else {
                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());
                    }
                    target.addPart(tableRef.newColumnReference(colRef.getColumn()));
                } else {
                    throw new IllegalStateException("Unknown part type: " + o.getClass().getName());
                }
            }
        } else {
View Full Code Here

                return getCombinedConstraint(selectStatementMetaData, cc);
            } else {
                return getCombinedConstraint(null, cc);
            }
        } else if (pConstraint instanceof BooleanConstraint) {
            BooleanConstraint bc = (BooleanConstraint) pConstraint;
            Statement st = bc.getConstrainedStatement();
            if (st instanceof SelectStatement) {
                StatementMetaData selectStatementMetaData = newStatementMetaData((SelectStatement) st);
                return getBooleanConstraint(selectStatementMetaData, bc);
            } else {
                return getBooleanConstraint(null, bc);
View Full Code Here

      parts.add(result);
      return result;
  }

  public BooleanConstraint createEQ() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.EQ);
    parts.add(result);
    return result;
  }
View Full Code Here

    parts.add(result);
    return result;
  }

  public BooleanConstraint createNE() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.NE);
    parts.add(result);
    return result;
  }
View Full Code Here

    parts.add(result);
    return result;
  }

  public BooleanConstraint createLT() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.LT);
    parts.add(result);
    return result;
  }
View Full Code Here

    parts.add(result);
    return result;
  }

  public BooleanConstraint createGT() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.GT);
    parts.add(result);
    return result;
  }
View Full Code Here

    parts.add(result);
    return result;
  }

  public BooleanConstraint createLE() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.LE);
    parts.add(result);
    return result;
  }
View Full Code Here

    parts.add(result);
    return result;
  }

  public BooleanConstraint createGE() {
    BooleanConstraint result = new BooleanConstraintImpl(this, BooleanConstraint.Type.GE);
    parts.add(result);
    return result;
  }
View Full Code Here

TOP

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

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.