Class ColumnMetadata

java.lang.Object
com.querydsl.sql.ColumnMetadata
All Implemented Interfaces:
Serializable

public final class ColumnMetadata extends Object implements Serializable
Provides metadata like the column name, JDBC type and constraints
See Also:
  • Method Details

    • getColumnMetadata

      public static ColumnMetadata getColumnMetadata(Path<?> path)
      Returns this path's column metadata if present. Otherwise returns default metadata where the column name is equal to the path's name.
    • getName

      public static String getName(Path<?> path)
      Extract the column name for the given path, returns the path name, if no ColumnMetadata is attached
      Parameters:
      path - patch
      Returns:
      column name or path name
    • named

      public static ColumnMetadata named(String name)
      Creates default column meta data with the given column name, but without any type or constraint information. Use the fluent builder methods to further configure it.
      Throws:
      NullPointerException - if the name is null
    • getName

      public String getName()
    • getIndex

      public int getIndex()
    • withIndex

      public ColumnMetadata withIndex(int index)
    • getJdbcType

      public int getJdbcType()
    • hasJdbcType

      public boolean hasJdbcType()
    • ofType

      public ColumnMetadata ofType(int jdbcType)
    • isNullable

      public boolean isNullable()
    • notNull

      public ColumnMetadata notNull()
    • getSize

      public int getSize()
      For char or date types this is the maximum number of characters, for numeric or decimal types this is precision.
      Returns:
      size
    • hasSize

      public boolean hasSize()
    • withSize

      public ColumnMetadata withSize(int size)
    • getDigits

      public int getDigits()
      the number of fractional digits
      Returns:
      digits
    • hasDigits

      public boolean hasDigits()
    • withDigits

      public ColumnMetadata withDigits(int decimalDigits)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object