org.chromattic.api.query
Interface ObjectQueryBuilder<O>

Type Parameters:
O - the object type parameter
All Superinterfaces:
Iterable<O>

public interface ObjectQueryBuilder<O>
extends Iterable<O>

Version:
$Revision$
Author:
Julien Viet

Method Summary
<O> ObjectQueryBuilder<O>
from(Class<O> fromClass)
          Set the node type of the from clause of the query.
 ObjectQuery<O> get()
          Compute and returns the ObjectQuery for this builder.
 ObjectQueryResult<O> iterator()
          Compute and executes the query.
<O> ObjectQueryBuilder<O>
orderBy(String orderBy)
          Set the order by clause of the query.
<O> ObjectQueryBuilder<O>
where(String where)
          Set the where clause of the query.
 

Method Detail

from

<O> ObjectQueryBuilder<O> from(Class<O> fromClass)
                           throws NullPointerException,
                                  IllegalStateException,
                                  IllegalArgumentException

Set the node type of the from clause of the query. It is possible to call that method only once and any attempt to call this method a second time will throw an IllegalStateException.

Type Parameters:
O - the object type parameter
Parameters:
fromClass - the node type of the from clause
Returns:
this builder
Throws:
NullPointerException - if the argument is null
IllegalStateException - if the builder already has a from clause
IllegalArgumentException - if the from class cannot be mapped to a node type

where

<O> ObjectQueryBuilder<O> where(String where)
                            throws NullPointerException

Set the where clause of the query.

Type Parameters:
O - the object type parameter
Parameters:
where - the where clause
Returns:
this builder
Throws:
NullPointerException - if the argument is null

orderBy

<O> ObjectQueryBuilder<O> orderBy(String orderBy)
                              throws NullPointerException

Set the order by clause of the query.

Type Parameters:
O - the object type parameter
Parameters:
orderBy - the order by clause
Returns:
this builder
Throws:
NullPointerException - if the argument is null

get

ObjectQuery<O> get()
                   throws IllegalStateException

Compute and returns the ObjectQuery for this builder.

Returns:
this object query
Throws:
IllegalStateException - if the builder cannot build the query

iterator

ObjectQueryResult<O> iterator()
                              throws IllegalStateException

Compute and executes the query.

Specified by:
iterator in interface Iterable<O>
Returns:
the query result
Throws:
IllegalStateException - if the builder cannot build the query to execute


Copyright © 2009 eXo Platform SAS. All Rights Reserved.