Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.broker.query
Class QueryByMtoNCriteria  view QueryByMtoNCriteria download QueryByMtoNCriteria.java

java.lang.Object
  extended byojb.broker.query.QueryByMtoNCriteria
All Implemented Interfaces:
Query, java.io.Serializable

public class QueryByMtoNCriteria
extends java.lang.Object
implements Query

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); Creation date: (24.01.2001 21:45:46)


Field Summary
private  java.lang.Class clazz
           
private  Criteria criteria
           
private  boolean distinct
           
private  java.lang.String[] tables
           
 
Constructor Summary
QueryByMtoNCriteria(java.lang.Class targetClass, java.lang.String[] tables, Criteria criteria)
          Build a Query for class targetClass with criteria.
QueryByMtoNCriteria(java.lang.Class targetClass, java.lang.String[] tables, Criteria criteria, boolean distinct)
          Build a Query for class targetClass with criteria.
 
Method Summary
 void changeClass(java.lang.Class aNewClass)
          change the item class to aNewClass, to fix m:n with extents issue this affects the tables and all EqualToColumnCriteria
 void changeClass(ojb.broker.metadata.ClassDescriptor aNewCld)
          change the item class to aNewClass, to fix m:n with extents issue this affects the tables and all EqualToColumnCriteria
private  void changeCriteriaTable(Criteria criteria, java.lang.String oldTable, java.lang.String newTable)
          change table names in the EqualToColumnCriteria
private  void changeTable(java.lang.String oldTable, java.lang.String newTable)
          change table names in the query
 Criteria getCriteria()
          Method declaration
 java.lang.Object getExampleObject()
          Method declaration
 java.lang.Class getSearchClass()
          Method declaration
 java.lang.String getTables()
          return tables separated by comma,
 boolean isDistinct()
          Gets the distinct.
 void setDistinct(boolean distinct)
          Sets the distinct.
 java.lang.String toString()
          Insert the method's description here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

private java.lang.Class clazz

tables

private java.lang.String[] tables

criteria

private Criteria criteria

distinct

private boolean distinct
Constructor Detail

QueryByMtoNCriteria

public QueryByMtoNCriteria(java.lang.Class targetClass,
                           java.lang.String[] tables,
                           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[] tables,
                           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

getTables

public java.lang.String getTables()
return tables separated by comma,


getCriteria

public Criteria getCriteria()
Method declaration

Specified by:
getCriteria in interface Query

getExampleObject

public java.lang.Object getExampleObject()
Method declaration

Specified by:
getExampleObject in interface Query

getSearchClass

public java.lang.Class getSearchClass()
Method declaration

Specified by:
getSearchClass in interface Query

toString

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


isDistinct

public boolean isDistinct()
Gets the distinct.

Specified by:
isDistinct in interface Query

setDistinct

public void setDistinct(boolean distinct)
Sets the distinct.


changeTable

private void changeTable(java.lang.String oldTable,
                         java.lang.String newTable)
change table names in the query


changeCriteriaTable

private void changeCriteriaTable(Criteria criteria,
                                 java.lang.String oldTable,
                                 java.lang.String newTable)
change table names in the EqualToColumnCriteria


changeClass

public void changeClass(java.lang.Class aNewClass)
change the item class to aNewClass, to fix m:n with extents issue this affects the tables and all EqualToColumnCriteria


changeClass

public void changeClass(ojb.broker.metadata.ClassDescriptor aNewCld)
change the item class to aNewClass, to fix m:n with extents issue this affects the tables and all EqualToColumnCriteria