Enum Class KeyColumnType

java.lang.Object
java.lang.Enum<KeyColumnType>
com.altibase.document.api.KeyColumnType
All Implemented Interfaces:
Serializable, Comparable<KeyColumnType>, Constable

public enum KeyColumnType extends Enum<KeyColumnType>
컬렉션의 키 컬럼으로 사용될 수 있는 데이터베이스 타입을 정의하는 Enum.

각 타입은 자신에게 매핑되는 Java 클래스, 사이즈 필요 여부, 유효성 검증, DDL 문자열 생성 등 자신과 관련된 모든 로직을 내장하고 있다.

  • Enum Constant Details

    • VARCHAR

      public static final KeyColumnType VARCHAR
      가변 길이 문자열 타입. 사이즈 지정이 필수이다.
    • CHAR

      public static final KeyColumnType CHAR
      고정 길이 문자열 타입. 사이즈 지정이 필수이다.
    • INT

      public static final KeyColumnType INT
      정수 타입. 사이즈를 지정할 수 없다.
    • SMALLINT

      public static final KeyColumnType SMALLINT
      작은 정수 타입. 사이즈를 지정할 수 없다.
    • BIGINT

      public static final KeyColumnType BIGINT
      큰 정수 타입. 사이즈를 지정할 수 없다.
  • Method Details

    • values

      public static KeyColumnType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static KeyColumnType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isRequiresSize

      public boolean isRequiresSize()
      이 키 타입이 사이즈 지정을 필요로 하는지 여부를 반환한다.
      Returns:
      사이즈가 필요하면 true
    • getJavaType

      public Class<?> getJavaType()
      이 키 타입에 해당하는 Java 클래스를 반환한다.
      Returns:
      매핑되는 Java Class 객체 (예: Integer.class)
    • buildTypeString

      public String buildTypeString(Integer aSize)
      데이터베이스 DDL에서 사용할 타입 문자열을 생성한다.
      Parameters:
      aSize - 타입의 크기 (필요한 경우 사용됨)
      Returns:
      최종 타입 문자열 (예: "VARCHAR(40)", "INT")
    • validateSize

      public abstract void validateSize(Integer aSize, Logger aLogger)
      해당 키 타입에 대해 주어진 size 값이 유효한지 검증한다.
      Parameters:
      aSize - 검증할 크기 값
      aLogger - 경고 로그를 남기기 위한 Logger 객체
      Throws:
      AltibaseSchemaException - 유효성 검증 실패 시
    • validateForUuidKey

      public abstract void validateForUuidKey(Integer aSize)
      이 키 타입이 UUID 키 생성 타입과 함께 사용될 때 유효한지 검증한다.
      Parameters:
      aSize - 키 타입의 크기
      Throws:
      AltibaseSchemaException - 유효하지 않을 경우
    • fromString

      public static KeyColumnType fromString(String aName)
      대소문자를 구분하지 않고 문자열로부터 KeyColumnType Enum 상수를 반환한다. 이 메서드는 enum의 기본 이름과 정의된 별칭(alias)을 모두 확인한다.
      Parameters:
      aName - 변환할 타입 이름 (e.g., "INT", "INTEGER")
      Returns:
      매칭되는 KeyGenerationType 상수
      Throws:
      IllegalArgumentException - 매칭되는 상수가 없거나 입력값이 null일 경우