org.apache.ojb.broker.query
Class QueryByMtoNCriteria

java.lang.Object
  extended by org.apache.ojb.broker.query.AbstractQueryImpl
      extended by org.apache.ojb.broker.query.QueryByCriteria
          extended by org.apache.ojb.broker.query.QueryByMtoNCriteria
All Implemented Interfaces:
java.io.Serializable, MtoNQuery, Query

public class QueryByMtoNCriteria
extends QueryByCriteria
implements MtoNQuery

represents a search by criteria. "find all articles where article.price > 100" could be represented as: Criteria crit = new Criteria(); crit.addGreaterThan("price", new Double(100)); Query qry = new QueryByCriteria(Article.class, crit); The PersistenceBroker can retrieve Objects by Queries as follows: PersistenceBroker broker = PersistenceBrokerFactory.createPersistenceBroker(); Collection col = broker.getCollectionByQuery(qry);

Version:
$Id: QueryByMtoNCriteria.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.query.QueryByCriteria
CRITERIA_SELECT_ALL
 
Fields inherited from interface org.apache.ojb.broker.query.Query
NO_END_AT_INDEX, NO_START_AT_INDEX, NOT_SCROLLABLE, SCROLLABLE
 
Constructor Summary
QueryByMtoNCriteria(java.lang.Class targetClass, java.lang.String indirectionTable, Criteria criteria)
          Build a Query for class targetClass with criteria.
QueryByMtoNCriteria(java.lang.Class targetClass, java.lang.String indirectionTable, Criteria criteria, boolean distinct)
          Build a Query for class targetClass with criteria.
 
Method Summary
 java.lang.String getIndirectionTable()
          return indirectionTable
 java.lang.String toString()
          Insert the method's description here.
 
Methods inherited from class org.apache.ojb.broker.query.QueryByCriteria
addGroupBy, addGroupBy, addGroupBy, addOrderBy, addOrderBy, addOrderBy, addOrderByAscending, addOrderByDescending, addPathClass, addPrefetchedRelationship, getClassesForPath, getCriteria, getGroupBy, getHavingCriteria, getObjectProjectionAttribute, getOrderBy, getOuterJoinPaths, getPathClasses, getPrefetchedRelationships, isDistinct, isPathOuterJoin, setCriteria, setDistinct, setHavingCriteria, setObjectProjectionAttribute, setObjectProjectionAttribute, setPathClass, setPathOuterJoin
 
Methods inherited from class org.apache.ojb.broker.query.AbstractQueryImpl
fullSize, fullSize, getBaseClass, getEndAtIndex, getExampleObject, getFetchSize, getSearchClass, getStartAtIndex, getWithExtents, setEndAtIndex, setFetchSize, setStartAtIndex, setWithExtents, usePaging
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryByMtoNCriteria

public QueryByMtoNCriteria(java.lang.Class targetClass,
                           java.lang.String indirectionTable,
                           Criteria criteria)
Build a Query for class targetClass with criteria. Criteriy may be null (will result in a query returning ALL objects from a table)


QueryByMtoNCriteria

public QueryByMtoNCriteria(java.lang.Class targetClass,
                           java.lang.String indirectionTable,
                           Criteria criteria,
                           boolean distinct)
Build a Query for class targetClass with criteria. Criteriy may be null (will result in a query returning ALL objects from a table)

Method Detail

getIndirectionTable

public java.lang.String getIndirectionTable()
return indirectionTable

Specified by:
getIndirectionTable in interface MtoNQuery
Returns:
Returns a String[]

toString

public java.lang.String toString()
Insert the method's description here. Creation date: (07.02.2001 22:01:55)

Overrides:
toString in class QueryByCriteria
Returns:
java.lang.String


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30