Interface ParameterHolder<X extends ParameterHolder<X>>

Type Parameters:
X - The concrete builder type
All Known Subinterfaces:
BaseCriteriaBuilder<T,​X>, BaseCTECriteriaBuilder<X>, BaseFromQueryBuilder<T,​X>, BaseQueryBuilder<T,​X>, BaseSubqueryBuilder<X>, CommonQueryBuilder<X>, CorrelationQueryBuilder<X>, CriteriaBuilder<T>, DeleteCriteriaBuilder<T>, FinalSetOperationCriteriaBuilder<T>, FullQueryBuilder<T,​X>, FullSelectCTECriteriaBuilder<X>, InsertCriteriaBuilder<T>, LeafOngoingSetOperationCriteriaBuilder<X>, LeafOngoingSetOperationCTECriteriaBuilder<X>, LeafOngoingSetOperationSubqueryBuilder<X>, ModificationCriteriaBuilder<X>, OngoingSetOperationCriteriaBuilder<T,​Y>, OngoingSetOperationCTECriteriaBuilder<T,​Y>, OngoingSetOperationSubqueryBuilder<T,​Y>, PaginatedCriteriaBuilder<T>, QueryBuilder<T,​X>, ReturningDeleteCriteriaBuilder<T,​X>, ReturningInsertCriteriaBuilder<T,​X>, ReturningModificationCriteriaBuilder<X,​Y>, ReturningUpdateCriteriaBuilder<T,​X>, SelectBaseCTECriteriaBuilder<X>, SelectCTECriteriaBuilder<X>, SelectRecursiveCTECriteriaBuilder<X>, StartOngoingSetOperationCriteriaBuilder<X,​Y>, StartOngoingSetOperationCTECriteriaBuilder<X,​Y>, StartOngoingSetOperationSubqueryBuilder<X,​Y>, SubqueryBuilder<T>, UpdateCriteriaBuilder<T>

public interface ParameterHolder<X extends ParameterHolder<X>>
A base interface for builders that can hold parameters.
Since:
1.2.0
Author:
Christian Beikov
  • Method Summary

    Modifier and Type Method Description
    boolean containsParameter​(String name)
    Returns true if a parameter with the given name is registered, otherwise false.
    javax.persistence.Parameter<?> getParameter​(String name)
    Returns the parameter object representing the parameter with the given name if containsParameter(String) returns true, otherwise null.
    Set<? extends javax.persistence.Parameter<?>> getParameters()
    Returns a set of all registered parameters.
    Object getParameterValue​(String name)
    Returns the set value for the parameter with the given name.
    boolean isParameterSet​(String name)
    Returns true if a parameter with the given name is registered and a value has been set, otherwise false.
    X setParameter​(String name, Object value)
    Sets the given value as the value for the parameter with the given name.
    X setParameter​(String name, Calendar value, javax.persistence.TemporalType temporalType)
    Sets the given Calendar value as the value for the parameter with the given name.
    X setParameter​(String name, Date value, javax.persistence.TemporalType temporalType)
    Sets the given Date value as the value for the parameter with the given name.
    X setParameterType​(String name, Class<?> type)
    Updates the type of the parameter with the given name.
  • Method Details

    • setParameter

      X setParameter​(String name, Object value)
      Sets the given value as the value for the parameter with the given name.
      Parameters:
      name - The name of the parameter which should be set
      value - The value of the parameter that should be set
      Returns:
      The query builder for chaining calls
    • setParameter

      X setParameter​(String name, Calendar value, javax.persistence.TemporalType temporalType)
      Sets the given Calendar value as the value for the parameter with the given name.
      Parameters:
      name - The name of the parameter which should be set
      value - The value of the parameter that should be set
      temporalType - The temporal type of the value
      Returns:
      The query builder for chaining calls
    • setParameter

      X setParameter​(String name, Date value, javax.persistence.TemporalType temporalType)
      Sets the given Date value as the value for the parameter with the given name.
      Parameters:
      name - The name of the parameter which should be set
      value - The value of the parameter that should be set
      temporalType - The temporal type of the value
      Returns:
      The query builder for chaining calls
    • containsParameter

      boolean containsParameter​(String name)
      Returns true if a parameter with the given name is registered, otherwise false.
      Parameters:
      name - The name of the parameter that should be checked
      Returns:
      True if the parameter is registered, otherwise false
    • isParameterSet

      boolean isParameterSet​(String name)
      Returns true if a parameter with the given name is registered and a value has been set, otherwise false.
      Parameters:
      name - The name of the parameter that should be checked
      Returns:
      True if the parameter is registered and a value has been set, otherwise false
    • getParameter

      javax.persistence.Parameter<?> getParameter​(String name)
      Returns the parameter object representing the parameter with the given name if containsParameter(String) returns true, otherwise null.
      Parameters:
      name - The name of the parameter that should be returned
      Returns:
      The parameter object if the parameter is registered, otherwise null
    • getParameters

      Set<? extends javax.persistence.Parameter<?>> getParameters()
      Returns a set of all registered parameters.
      Returns:
      The set of registered parameters
    • getParameterValue

      Object getParameterValue​(String name)
      Returns the set value for the parameter with the given name. If no value has been set, or the parameter does not exist, null is returned.
      Parameters:
      name - The name of the parameter for which the value should be returned
      Returns:
      The value of the parameter or null if no value has been set or the parameter does not exist
    • setParameterType

      X setParameterType​(String name, Class<?> type)
      Updates the type of the parameter with the given name.
      Parameters:
      name - The name of the parameter for which the type should be set
      type - The value of the parameter that should be set
      Returns:
      The query builder for chaining calls
      Since:
      1.2.0