Skip to main content

Type Support

The table recommends Java property types for common columns. Use wrapper types for nullable fields. See Java/JDBC types and enum mapping.

Type Mappings​

Database field typeJava typeDescription
SMALLINTShortCovers the range of this signed integer type.
INTIntegerCovers the range of this signed integer type.
BIGINTLongCovers the range of this signed integer type.
REALFloatApproximate values; not for amounts requiring exact decimal arithmetic.
DOUBLEDoubleApproximate values; not for amounts requiring exact decimal arithmetic.
DECIMAL(10, 2)BigDecimalRetains decimal values; writes are constrained by column precision and scale.
DECIMAL(20, 0)BigInteger / BigDecimalUse BigInteger for integral business values, or BigDecimal for a common decimal model.
BOOLEANBooleanUse Boolean semantics, not a general integer property.
CHAR(1)StringText content; the column definition constrains length.
VARCHAR(255)StringText content; the column definition constrains length.
VARBINARY(1000)byte[]Binary content without character encoding conversion.
BLOBbyte[]Binary content without character encoding conversion.
DATEjava.sql.DateDate only; not for preserving a complete timestamp.
TIMEjava.sql.TimeTime only; text storage requires a parseable time format.
TIMESTAMPjava.sql.TimestampPreserves date and time, subject to column precision.
CLOBMap / List / BeanWhen storing JSON text, see JSON Field Mapping.

Array Types​

NULL can be read as a Java null, but non-null arrays cannot be bound, read, or updated through the generic JDBC ARRAY mapping. For example, binding Integer[] with Types.ARRAY is not supported.

To store a list in one field, use a suitable text or JSON column and JSON field mapping. Do not configure that column as JDBC ARRAY. This is separate from expanding a list into an IN condition.