java.lang.Object
org.springframework.data.repository.query.Parameter

public class Parameter extends Object
Class to abstract a single parameter of a query method. It is held in the context of a Parameters instance.
Author:
Oliver Gierke, Mark Paluch, Jens Schauder, Greg Turnquist, Johannes Englmeier
  • Constructor Details

    • Parameter

      @Deprecated(since="3.1", forRemoval=true) protected Parameter(org.springframework.core.MethodParameter parameter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new Parameter for the given MethodParameter.
      Parameters:
      parameter - must not be null.
    • Parameter

      protected Parameter(org.springframework.core.MethodParameter parameter, TypeInformation<?> domainType)
      Creates a new Parameter for the given MethodParameter and domain TypeInformation.
      Parameters:
      parameter - must not be null.
      domainType - must not be null.
      Since:
      3.0.2
  • Method Details

    • isSpecialParameter

      public boolean isSpecialParameter()
      Returns whether the parameter is a special parameter.
      Returns:
      See Also:
      • TYPES
    • isBindable

      public boolean isBindable()
      Returns whether the Parameter is to be bound to a query.
      Returns:
    • isDynamicProjectionParameter

      public boolean isDynamicProjectionParameter()
      Returns whether the current Parameter is the one used for dynamic projections.
      Returns:
    • getPlaceholder

      public String getPlaceholder()
      Returns the placeholder to be used for the parameter. Can either be a named one or positional.
      Returns:
    • getIndex

      public int getIndex()
      Returns the position index the parameter is bound to in the context of its surrounding Parameters.
      Returns:
    • isNamedParameter

      public boolean isNamedParameter()
      Returns whether the parameter is annotated with Param.
      Returns:
    • getName

      public Optional<String> getName()
      Returns the name of the parameter (through Param annotation).
      Returns:
    • getType

      public Class<?> getType()
      Returns the type of the Parameter.
      Returns:
      the type
    • isExplicitlyNamed

      public boolean isExplicitlyNamed()
      Returns whether the parameter is named explicitly, i.e. annotated with Param.
      Returns:
      Since:
      1.11
    • toString

      public String toString()
      Overrides:
      toString in class Object