org.apache.ojb.broker.query
Class QueryByMtoNCriteria
java.lang.Object
org.apache.ojb.broker.query.AbstractQueryImpl
org.apache.ojb.broker.query.QueryByCriteria
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
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 |
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)
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 - 2005 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