org.apache.ojb.soda
Class QueryImpl

java.lang.Object
  extended byorg.apache.ojb.soda.QueryImpl
All Implemented Interfaces:
Query, java.io.Serializable

public class QueryImpl
extends java.lang.Object
implements Query, java.io.Serializable

Version:
$Id: QueryImpl.java,v 1.5 2004/01/07 11:41:21 thma Exp $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
           
 
Constructor Summary
QueryImpl(PersistenceBroker broker)
          Constructor for QueryImpl.
QueryImpl(Query query)
          wrapping constructor.
 
Method Summary
 Constraint constrain(java.lang.Object example)
          adds a constraint to this node.
 Query descendant(java.lang.String path)
          returns a reference to a descendant node in the query graph.
 ObjectSet execute()
          executes the query.
 Query limitSize(int count)
          limits the maximum amount of objects returned.
 Query orderAscending()
          adds an ascending order criteria to this node of the query graph.
 Query orderDescending()
          adds a descending order criteria to this node of the query graph.
 Query parent(java.lang.String path)
          returns a reference to a parent node in the query graph.
 void setOjbQuery(Query ojbQuery)
          Sets the ojbQuery, needed only as long we don't support the soda constraint stuff.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

QueryImpl

public QueryImpl(PersistenceBroker broker)
Constructor for QueryImpl.


QueryImpl

public QueryImpl(Query query)
wrapping constructor. needed only as long we don't support the soda constraint stuff.

Method Detail

constrain

public Constraint constrain(java.lang.Object example)
Description copied from interface: Query
adds a constraint to this node.
If the object parameter is deeper than the entire query graph, the query graph is extended accordingly.

Specified by:
constrain in interface Query
Parameters:
example - object for comparison
Returns:
Constraint

execute

public ObjectSet execute()
Description copied from interface: Query
executes the query.

Specified by:
execute in interface Query
Returns:
ObjectSet - the resultset of the Query

descendant

public Query descendant(java.lang.String path)
Description copied from interface: Query
returns a reference to a descendant node in the query graph. If the node does not exist, it will be created. Path notation:
"[membername].[membername].[membername]"
(any number of members)

To request references to elements of multi-element objects like arrays, lists, vectors, maps, hashMaps, ...:
"[membername].[membername].[membername]."
(Note the extra "." at the end.)

Specified by:
descendant in interface Query
Parameters:
path - path to the descendant. "[membername].[membername]"
Returns:
Query descendant node - the member node at the end of the path specified.

parent

public Query parent(java.lang.String path)
Description copied from interface: Query
returns a reference to a parent node in the query graph. If the node does not exist, it will be created. Path notation:
"[classname].[membername].[membername]"
where the last member is this Query node.

Specified by:
parent in interface Query
Parameters:
path - to the parent node "[classname].[membername]"
Returns:
Query parent node - the class node at the beginning of the path specified.

limitSize

public Query limitSize(int count)
Description copied from interface: Query
limits the maximum amount of objects returned. Especially for sorted queries, large performance advantages are possible.

Specified by:
limitSize in interface Query
Parameters:
count - - the maximum amount of objects desired.
Returns:
this Query to allow the chaining of method calls

orderAscending

public Query orderAscending()
Description copied from interface: Query
adds an ascending order criteria to this node of the query graph. In case of multiple calls to ordering methods, the query graph is ordered by all criteria in the order they were called.

Specified by:
orderAscending in interface Query
Returns:
this Query to allow the chaining of method calls

orderDescending

public Query orderDescending()
Description copied from interface: Query
adds a descending order criteria to this node of the query graph. In case of multiple calls to ordering methods, the query graph is ordered by all criteria in the order they were called.

Specified by:
orderDescending in interface Query
Returns:
this Query to allow the chaining of method calls

setOjbQuery

public void setOjbQuery(Query ojbQuery)
Sets the ojbQuery, needed only as long we don't support the soda constraint stuff.

Parameters:
ojbQuery - The ojbQuery to set


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14