Class SqlColumn<T>

    • Field Detail

      • name

        protected final java.lang.String name
      • jdbcType

        protected final java.sql.JDBCType jdbcType
      • isDescending

        protected boolean isDescending
      • alias

        protected java.lang.String alias
      • typeHandler

        protected java.lang.String typeHandler
    • Constructor Detail

      • SqlColumn

        protected SqlColumn​(SqlColumn<T> sqlColumn)
    • Method Detail

      • name

        public java.lang.String name()
      • jdbcType

        public java.util.Optional<java.sql.JDBCType> jdbcType()
        Specified by:
        jdbcType in interface BindableColumn<T>
      • alias

        public java.util.Optional<java.lang.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
      • typeHandler

        public java.util.Optional<java.lang.String> typeHandler()
        Specified by:
        typeHandler in interface BindableColumn<T>
      • descending

        public SortSpecification 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
      • as

        public SqlColumn<T> as​(java.lang.String alias)
        Description copied from interface: BindableColumn
        Override the base method definition to make it more specific to this interface.
        Specified by:
        as in interface BasicColumn
        Specified by:
        as in interface BindableColumn<T>
        Parameters:
        alias - the column alias to set
        Returns:
        new instance with alias set
      • isDescending

        public boolean isDescending()
        Description copied from interface: SortSpecification
        Return true if the sort order is descending.
        Specified by:
        isDescending in interface SortSpecification
        Returns:
        true if the SortSpecification should render as descending
      • aliasOrName

        public java.lang.String aliasOrName()
        Description copied from interface: SortSpecification
        Return the column alias or column name.
        Specified by:
        aliasOrName in interface SortSpecification
        Returns:
        the column alias if one has been specified by the user, or else the column name
      • renderWithTableAlias

        public java.lang.String renderWithTableAlias​(TableAliasCalculator tableAliasCalculator)
        Description copied from interface: BasicColumn
        Returns the name of the item aliased with a table name if appropriate. For example, "a.foo". This is appropriate for where clauses and order by clauses.
        Specified by:
        renderWithTableAlias in interface BasicColumn
        Parameters:
        tableAliasCalculator - the table alias calculator for the current renderer
        Returns:
        the item name with the table alias applied
      • withTypeHandler

        @NotNull
        public <S> SqlColumn<S> withTypeHandler​(java.lang.String typeHandler)
      • of

        public static <T> SqlColumn<T> of​(java.lang.String name,
                                          SqlTable table)
      • of

        public static <T> SqlColumn<T> of​(java.lang.String name,
                                          SqlTable table,
                                          java.sql.JDBCType jdbcType)