Spring Data Commons

org.springframework.data.repository.query.parser
Class AbstractQueryCreator<T,S>

java.lang.Object
  extended by org.springframework.data.repository.query.parser.AbstractQueryCreator<T,S>

public abstract class AbstractQueryCreator<T,S>
extends Object

Base class for query creators that create criteria based queries from a PartTree.

Author:
Oliver Gierke

Constructor Summary
AbstractQueryCreator(PartTree tree, ParameterAccessor parameters)
          Creates a new AbstractQueryCreator for the given PartTree and ParametersParameterAccessor.
 
Method Summary
protected abstract  S and(Part part, S base, Iterator<Object> iterator)
          Creates a new criteria object from the given part and and-concatenates it to the given base criteria.
protected abstract  T complete(S criteria, Sort sort)
          Actually creates the query object applying the given criteria object and Sort definition.
protected abstract  S create(Part part, Iterator<Object> iterator)
          Creates a new atomic instance of the criteria object.
 T createQuery()
          Creates the actual query object.
protected abstract  S or(S base, S criteria)
          Or-concatenates the given base criteria to the given new criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractQueryCreator

public AbstractQueryCreator(PartTree tree,
                            ParameterAccessor parameters)
Creates a new AbstractQueryCreator for the given PartTree and ParametersParameterAccessor.

Parameters:
tree -
parameters -
Method Detail

createQuery

public T createQuery()
Creates the actual query object.

Returns:

create

protected abstract S create(Part part,
                            Iterator<Object> iterator)
Creates a new atomic instance of the criteria object.

Parameters:
part -
iterator -
Returns:

and

protected abstract S and(Part part,
                         S base,
                         Iterator<Object> iterator)
Creates a new criteria object from the given part and and-concatenates it to the given base criteria.

Parameters:
part -
base - will never be null.
iterator -
Returns:

or

protected abstract S or(S base,
                        S criteria)
Or-concatenates the given base criteria to the given new criteria.

Parameters:
base -
criteria -
Returns:

complete

protected abstract T complete(S criteria,
                              Sort sort)
Actually creates the query object applying the given criteria object and Sort definition.

Parameters:
criteria -
sort -
Returns:

Spring Data Commons

Copyright © 2011. All Rights Reserved.