Package org.apache.ojb.broker.query

Examples of org.apache.ojb.broker.query.SelectionCriteria


    public void bind(Object parameter)
            throws org.odmg.QueryParameterCountInvalidException, org.odmg.QueryParameterTypeInvalidException
    {
        try
        {
            SelectionCriteria crit = (SelectionCriteria) getBindIterator().next();
            crit.bind(parameter);

            // BRJ: bind is called twice for between
            if (crit instanceof BetweenCriteria && !crit.isBound())
            {
                getBindIterator().previous();
            }
        }
        catch (Exception e)
View Full Code Here


                Criteria pc = (Criteria) o;
                flatten(pc, acc);
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                // BRJ : only add bindable criteria
                if (!c.isBound())
                {
                    acc.add(c);
                }
            }
        }
View Full Code Here

                    Criteria pc = (Criteria) o;
                    param = bindStatement(stmt, pc, cld, param);
                }
                else
                {
                    SelectionCriteria c = (SelectionCriteria) o;
                    // BRJ : bind once for the criterion's main class
                    param = bindSelectionCriteria(stmt, param, c, cld);

                    // BRJ : and once for each extent
                    for (int i = 0; i < c.getNumberOfExtentsToBind(); i++)
                    {
                        param = bindSelectionCriteria(stmt, param, c, cld);
                    }
                }
            }
View Full Code Here

                        }
                }
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                if (statement.length() == 0)
                {
                    statement.append(asSQLClause(c, cld));
                }
                else
View Full Code Here

                        }
                }
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                if (statement.length() > 0)
                {
                    statement.insert(0, "(");
                    statement.append(") AND ");
                }
View Full Code Here

            {
                buildJoinTree((Criteria) o);
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
               
                // BRJ skip SqlCriteria
                if (c instanceof SqlCriteria)
                {
                    continue;
                }
               
                // BRJ: Outer join for OR
                boolean useOuterJoin = (crit.getType() == Criteria.OR);

                // BRJ: do not build join tree for subQuery attribute                 
                if (c.getAttribute() != null && c.getAttribute() instanceof String)
                {
          //buildJoinTreeForColumn((String) c.getAttribute(), useOuterJoin, c.getAlias(), c.getPathClasses());
          buildJoinTreeForColumn((String) c.getAttribute(), useOuterJoin, c.getUserAlias(), c.getPathClasses());
                }
                if (c instanceof FieldCriteria)
                {
                    FieldCriteria cc = (FieldCriteria) c;
          buildJoinTreeForColumn((String) cc.getValue(), useOuterJoin, c.getUserAlias(), c.getPathClasses());
                }
            }
        }
    }
View Full Code Here

    public void bind(Object parameter)
            throws org.odmg.QueryParameterCountInvalidException, org.odmg.QueryParameterTypeInvalidException
    {
        try
        {
            SelectionCriteria crit = (SelectionCriteria) getBindIterator().next();
            crit.bind(parameter);

            // BRJ: bind is called twice for between
            if (crit instanceof BetweenCriteria && !crit.isBound())
            {
                getBindIterator().previous();
            }
        }
        catch (Exception e)
View Full Code Here

                Criteria pc = (Criteria) o;
                flatten(pc, acc);
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                // BRJ : only add bindable criteria
                if (!c.isBound())
                {
                    acc.add(c);
                }
            }
        }
View Full Code Here

                    Criteria pc = (Criteria) o;
                    param = bindStatement(stmt, pc, cld, param);
                }
                else
                {
                    SelectionCriteria c = (SelectionCriteria) o;
                    // BRJ : bind once for the criterion's main class
                    param = bindSelectionCriteria(stmt, param, c, cld);

                    // BRJ : and once for each extent
                    for (int i = 0; i < c.getNumberOfExtentsToBind(); i++)
                    {
                        param = bindSelectionCriteria(stmt, param, c, cld);
                    }
                }
            }
View Full Code Here

                        }
                }
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                if (statement.length() == 0)
                {
                    statement.append(asSQLClause(c, cld));
                }
                else
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.query.SelectionCriteria

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.