Spring Data JPA

org.springframework.data.jpa.repository.query
Class ParameterBinder

java.lang.Object
  extended by org.springframework.data.jpa.repository.query.ParameterBinder
Direct Known Subclasses:
StringQueryParameterBinder

public class ParameterBinder
extends Object

ParameterBinder is used to bind method parameters to a Query. This is usually done whenever an AbstractJpaQuery is executed.

Author:
Oliver Gierke, Thomas Darimont

Constructor Summary
ParameterBinder(JpaParameters parameters, Object[] values)
          Creates a new ParameterBinder.
 
Method Summary
protected  void bind(javax.persistence.Query query, org.springframework.data.jpa.repository.query.JpaParameters.JpaParameter parameter, Object value, int position)
           
<T extends javax.persistence.Query>
T
bind(T query)
          Binds the parameters to the given Query.
 javax.persistence.Query bindAndPrepare(javax.persistence.Query query)
          Binds the parameters to the given query and applies special parameter types (e.g. pagination).
 Pageable getPageable()
          Returns the Pageable of the parameters, if available.
 Sort getSort()
          Returns the sort instance to be used for query creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterBinder

public ParameterBinder(JpaParameters parameters,
                       Object[] values)
Creates a new ParameterBinder.

Parameters:
parameters - must not be null.
values - must not be null.
Method Detail

getPageable

public Pageable getPageable()
Returns the Pageable of the parameters, if available. Returns null otherwise.

Returns:

getSort

public Sort getSort()
Returns the sort instance to be used for query creation. Will use a Sort parameter if available or the Sort contained in a Pageable if available. Returns null if no Sort can be found.

Returns:

bind

public <T extends javax.persistence.Query> T bind(T query)
Binds the parameters to the given Query.

Parameters:
query -
Returns:

bind

protected void bind(javax.persistence.Query query,
                    org.springframework.data.jpa.repository.query.JpaParameters.JpaParameter parameter,
                    Object value,
                    int position)

bindAndPrepare

public javax.persistence.Query bindAndPrepare(javax.persistence.Query query)
Binds the parameters to the given query and applies special parameter types (e.g. pagination).

Parameters:
query -
Returns:

Spring Data JPA

Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.