Class

stark.migration

OracleIntegerColumnDefinition

Related Doc: package migration

Permalink

class OracleIntegerColumnDefinition extends DefaultIntegerColumnDefinition

Map the INTEGER SQL type to a NUMBER(10, 0).

A few other databases, such as Derby, MySQL and PostgreSQL, treat INTEGER as a 4-byte signed integer type. On Oracle a NUMBER(10, 0) is large enough to store any integers from -2147483648 to 2147483647 but not any integers with more digits. A NUMBER(10, 0) does allow a larger range of values than the other databases, from -9999999999 to 9999999999, but this seems like an acceptable solution without using a CHECK constraint.

This behavior is different than Oracle's default. If a column is defined using "INTEGER" and not a "NUMBER", Oracle uses a NUMBER(38) to store it:

http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#sthref218

Using a NUMBER(10, 0) helps ensure the compatibility of any code running against an Oracle database so that is does not assume it can use 38-digit integer values in case the data needs to be exported to another database or if the code needs to work with other databases. Columns wishing to use a NUMBER(38) should use a DecimalType column.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OracleIntegerColumnDefinition
  2. DefaultIntegerColumnDefinition
  3. ColumnSupportsDefault
  4. ColumnDefinition
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OracleIntegerColumnDefinition()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. var adapterOpt: Option[DatabaseAdapter]

    Permalink

    The database adapter associated with this column definition, which may or may not be set.

    The database adapter associated with this column definition, which may or may not be set.

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. var columnNameOpt: Option[String]

    Permalink

    The column's name, which may or may not be set.

    The column's name, which may or may not be set.

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
  8. def comment: Option[String]

    Permalink

    得到注释

    得到注释

    returns

    得到注释

    Attributes
    protected
    Definition Classes
    ColumnDefinition
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getAdapter: DatabaseAdapter

    Permalink

    The database adapter associated with this column definition.

    The database adapter associated with this column definition.

    returns

    the database adapter associated with this column definition

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
    Exceptions thrown

    java.util.NoSuchElementException if the database adapter has not been associated with this column definition

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getColumnName: String

    Permalink

    Get the column's name.

    Get the column's name.

    returns

    the column name

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
    Exceptions thrown

    java.util.NoSuchElementException if the column name has not been set

  15. def getTableName: String

    Permalink

    Get the table name the column is defined in.

    Get the table name the column is defined in.

    returns

    the table name the column is defined in

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
    Exceptions thrown

    java.util.NoSuchElementException if the table name has not been set

  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. def initialize(): Unit

    Permalink

    Called after the above properties have been wired.

    Called after the above properties have been wired.

    Definition Classes
    ColumnDefinition
  18. var isAutoIncrement: Boolean

    Permalink

    If AutoIncrement is specified for the column.

    If AutoIncrement is specified for the column.

    Attributes
    protected
    Definition Classes
    ColumnDefinition
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def limit: Option[String]

    Permalink

    Get the limit for the column.

    Get the limit for the column.

    Attributes
    protected
    Definition Classes
    ColumnDefinition
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def optionallyAddLimitToDataType(columnTypeName: String): String

    Permalink

    Given the SQL for a column data type, return it with the LIMIT syntax appended if a limit is specified on the column definition instance, otherwise return SQL unmodified.

    Given the SQL for a column data type, return it with the LIMIT syntax appended if a limit is specified on the column definition instance, otherwise return SQL unmodified.

    columnTypeName

    the column type name

    returns

    the column type name with the limit syntax if the column definition specifies a limit

    Attributes
    protected
    Definition Classes
    ColumnDefinition
  25. def optionallyAddLimitToDataType(columnTypeName: String, limitOpt: Option[String]): String

    Permalink

    Given the SQL for a column data type, return it with the LIMIT syntax appended if a limit is given, otherwise return SQL unmodified.

    Given the SQL for a column data type, return it with the LIMIT syntax appended if a limit is given, otherwise return SQL unmodified.

    columnTypeName

    the column type name

    limitOpt

    optional column limit

    returns

    the column type name with the limit syntax if a limit was given

    Attributes
    protected
    Definition Classes
    ColumnDefinition
  26. var options: List[ColumnOption]

    Permalink

    Column options.

    Column options.

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
  27. def precision: Option[Int]

    Permalink

    Get the precision for the column.

    Get the precision for the column.

    Definition Classes
    ColumnDefinition
  28. def scale: Option[Int]

    Permalink

    Get the scale for the column.

    Get the scale for the column.

    Definition Classes
    ColumnDefinition
  29. def sql: String

    Permalink
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. var tableNameOpt: Option[String]

    Permalink

    The table name the column is defined in, which may or may not be set.

    The table name the column is defined in, which may or may not be set.

    Attributes
    protected[stark.migration]
    Definition Classes
    ColumnDefinition
  32. final def toCommentSql: Option[String]

    Permalink
    Definition Classes
    ColumnDefinition
  33. final def toSql: String

    Permalink
    Definition Classes
    ColumnDefinition
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ColumnSupportsDefault

Inherited from ColumnDefinition

Inherited from AnyRef

Inherited from Any

Ungrouped