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


public interface QueryBuilder<O>

The query builder allows to create queries.

Version:
$Revision$
Author:
Julien Viet

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

Method Detail

from

<O> QueryBuilder<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> QueryBuilder<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> QueryBuilder<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

Query<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


Copyright © 2010 eXo Platform SAS. All Rights Reserved.