Class SqlColumn<T>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SqlColumn.Builder  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String alias  
      protected boolean isDescending  
      protected java.sql.JDBCType jdbcType  
      protected java.lang.String name  
      protected SqlTable table  
      protected java.lang.String typeHandler  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SqlColumn​(SqlColumn<?> sqlColumn)  
    • Method Summary

      Modifier and Type Method Description
      java.util.Optional<java.lang.String> alias()
      Returns the columns alias if one has been specified.
      java.lang.String aliasOrName()
      Return the column alias or column name.
      SqlColumn<T> as​(java.lang.String alias)
      Override the base method definition to make it more specific to this interface.
      SortSpecification descending()
      Returns a new instance of the SortSpecification that should render as descending in an ORDER BY clause.
      boolean isDescending()
      Return true if the sort order is descending.
      java.util.Optional<java.sql.JDBCType> jdbcType()  
      java.lang.String name()  
      static <T> SqlColumn<T> of​(java.lang.String name, SqlTable table)  
      static <T> SqlColumn<T> of​(java.lang.String name, SqlTable table, java.sql.JDBCType jdbcType)  
      java.lang.String renderWithTableAlias​(TableAliasCalculator tableAliasCalculator)
      Returns the name of the item aliased with a table name if appropriate.
      java.util.Optional<java.lang.String> typeHandler()  
      static SqlColumn.Builder withName​(java.lang.String name)  
      SqlColumn<T> withTypeHandler​(java.lang.String typeHandler)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
      • jdbcType

        protected 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<?> 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 SortSpcification 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

        public SqlColumn<T> 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)