Class TypeQualifiers

java.lang.Object
net.java.ao.types.TypeQualifiers

public class TypeQualifiers extends Object
Describes optional modifiers to a type: string length for string types, precision and scale for numeric types. Each TypeInfo may have default qualifiers set by the database provider; qualifiers may also be modified by annotations.
  • Field Details

    • MAX_STRING_LENGTH

      public static final int MAX_STRING_LENGTH
      Maximum string length (for strings of limited length) cannot be set to greater than this value. This is the lowest common denominator for maximum string length in all supported databases.
      See Also:
    • OLD_MAX_STRING_LENGTH

      public static final int OLD_MAX_STRING_LENGTH
      String sizes were tuned down due to a SQL server limitation, this has the undesired side effect that existing tables read with lengths between 450 and 767 are incorrectly seen as clobs
      See Also:
    • UNLIMITED_LENGTH

      public static final int UNLIMITED_LENGTH
      If stringLength is set to this constant, the field is an unlimited-length string (TEXT, CLOB, or LONG VARCHAR).
      See Also:
  • Method Details

    • qualifiers

      public static TypeQualifiers qualifiers()
    • precision

      public TypeQualifiers precision(int precision)
    • scale

      public TypeQualifiers scale(int scale)
    • stringLength

      public TypeQualifiers stringLength(int stringLength)
    • withQualifiers

      public TypeQualifiers withQualifiers(TypeQualifiers overrides)
    • getPrecision

      public Integer getPrecision()
    • getScale

      public Integer getScale()
    • getStringLength

      public Integer getStringLength()
    • isDefined

      public boolean isDefined()
    • hasPrecision

      public boolean hasPrecision()
    • hasScale

      public boolean hasScale()
    • hasStringLength

      public boolean hasStringLength()
    • isUnlimitedLength

      public boolean isUnlimitedLength()
    • areLengthsCorrect

      public boolean areLengthsCorrect()
      If there is a disparity between reportedLength and the stringLength then the field is incompatible
    • isUnlimitedStringLengthSupportCompatible

      public boolean isUnlimitedStringLengthSupportCompatible(TypeQualifiers other)
    • areCompatible

      public static boolean areCompatible(TypeQualifiers derivedFromEntityAnnotations, TypeQualifiers derivedFromTableMetadata)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object