Class SimpleCaseModel<T>

java.lang.Object
org.mybatis.dynamic.sql.select.caseexpression.SimpleCaseModel<T>
All Implemented Interfaces:
BasicColumn, SortSpecification

public class SimpleCaseModel<T> extends Object implements BasicColumn, SortSpecification
  • Method Details

    • column

      public BindableColumn<T> column()
    • whenConditions

      public Stream<SimpleCaseWhenCondition<T>> whenConditions()
    • elseValue

      public Optional<BasicColumn> elseValue()
    • alias

      public Optional<String> alias()
      Description copied from interface: BasicColumn
      Returns the columns alias if one has been specified.
      Specified by:
      alias in interface BasicColumn
      Returns:
      the column alias
    • as

      public SimpleCaseModel<T> as(String alias)
      Description copied from interface: BasicColumn
      Returns a new instance of a BasicColumn with the alias set.
      Specified by:
      as in interface BasicColumn
      Parameters:
      alias - the column alias to set
      Returns:
      new instance with alias set
    • descending

      public SimpleCaseModel<T> descending()
      Description copied from interface: SortSpecification
      Returns a new instance of the SortSpecification that should render as descending in an ORDER BY clause.
      Specified by:
      descending in interface SortSpecification
      Returns:
      new instance of SortSpecification
    • renderForOrderBy

      public FragmentAndParameters renderForOrderBy(RenderingContext renderingContext)
      Description copied from interface: SortSpecification
      Return a fragment rendered for use in an ORDER BY clause. The fragment should include "DESC" if a descending order is desired.
      Specified by:
      renderForOrderBy in interface SortSpecification
      Parameters:
      renderingContext - the current rendering context
      Returns:
      a rendered fragment and parameters if applicable
    • render

      public FragmentAndParameters render(RenderingContext renderingContext)
      Description copied from interface: BasicColumn
      Returns a rendering of the column. The rendered fragment should include the table alias based on the TableAliasCalculator in the RenderingContext. The fragment could contain prepared statement parameter markers and associated parameter values if desired.
      Specified by:
      render in interface BasicColumn
      Parameters:
      renderingContext - the rendering context (strategy, sequence, etc.)
      Returns:
      a rendered SQL fragment and, optionally, parameters associated with the fragment