jakarta.persistence.Column annotation.
For example, @Column(length=LONG16) would specify
that Hibernate should generate DDL with a column type
capable of holding strings with 16-bit lengths.
jakarta.persistence.Column#length()
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT
The default length for a column in JPA. |
| public static final int | LOB_DEFAULT
The default length for a LOB column, on databases where LOB columns have a length. |
| public static final int | LONG
Used to select a variable-length SQL type large enough to contain values of maximum length 32600. |
| public static final int | LONG16
The maximum length that fits in 16 bits. |
| public static final int | LONG32
The maximum length of a Java string or array, that is, the maximum length that fits in 32 bits. |
| Access | Constructor and Description |
|---|---|
| private |
| DEFAULT | back to summary |
|---|---|
| public static final int DEFAULT The default length for a column in JPA. | |
| LOB_DEFAULT | back to summary |
|---|---|
| public static final int LOB_DEFAULT The default length for a LOB column, on databases where LOB columns have a length. | |
| LONG | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public static final int LONG Used to select a variable-length SQL type large enough to contain values of maximum length 32600. This arbitrary-looking number was chosen because some databases support variable-length types right up to a limit that is just slightly below 32767. (For some, the limit is 32672 characters.)
This is also the default length for a column
declared using
For example,
| |||||||||
| LONG16 | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public static final int LONG16 The maximum length that fits in 16 bits. Used to select a variable-length SQL type large enough to accommodate values of maximum length 32767.
For example,
| |||||||||
| LONG32 | back to summary | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| public static final int LONG32 The maximum length of a Java string or array, that is, the maximum length that fits in 32 bits. Used to select a variable-length SQL type large enough to accommodate any Java string up to the maximum possible length 2147483647.
This is also the default length for a column
declared using
For example,
| |||||||||
| Length | back to summary |
|---|---|
| private Length() | |