ojb.soda
Class QueryImpl

java.lang.Object
  |
  +--ojb.soda.QueryImpl
All Implemented Interfaces:
Query

public class QueryImpl
extends java.lang.Object
implements Query

Version:
1.0
Author:
Thomas Mahler

Constructor Summary
QueryImpl()
          Constructor for QueryImpl.
QueryImpl(Query query)
          wrapping constructor. needed only as long we don't support the soda constraint stuff.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryImpl

public QueryImpl()
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


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04