H2

Data type

RapidClipse default mapping

Generated Javacode (example)

CHARACTER(n)

A Unicode string. This type is supported for compatibility with other databases and older applications. The difference to VARCHAR is that trailing spaces are ignored and not persisted.

The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is kept in memory when using this data type.

visitor.addPropertyColumnDefinitionFix(new PropertyColumnDefinitionFix(
    new String[]{"CHARACTER"},new String[]{"java.lang.String"},"CHARACTER"));
java
private String charactertest;
java
@Column(name = "CHARACTERTEST", length = 10,
            columnDefinition = "CHARACTER")
public String getCharactertest() {
    return this.charactertest;
}
java

CHAR(n)

A Unicode string. This type is supported for compatibility with other databases and older applications. The difference to VARCHAR is that trailing spaces are ignored and not persisted.

The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is kept in memory when using this data type.

visitor.addPropertyColumnDefinitionFix(new PropertyColumnDefinitionFix(
    new String[]{"CHAR"},new String[]{"java.lang.String"},"CHAR"));
java
private String chartest;
java
@Column(name = "CHARTEST", length = 10,
            columnDefinition = "CHAR")
public String getChartest() {
    return this.chartest;
}
java

NCHAR(n)

A Unicode string. This type is supported for compatibility with other databases and older applications. The difference to VARCHAR is that trailing spaces are ignored and not persisted.

The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is kept in memory when using this data type.

visitor.addPropertyColumnDefinitionFix(new PropertyColumnDefinitionFix(
    new String[]{"NCHAR"},new String[]{"java.lang.String"},"CHAR"));
java
private String nchartest;
java
@Column(name = "NCHARTEST", length = 10,
            columnDefinition = "CHAR")
public String getNchartest() {
    return this.nchartest;
}
java

INT

Possible values: -2147483648 to 2147483647.

Hibernate default mapping

private int inttest;
java
@Column(name = "INTTEST", unique = true,
            nullable = false)
public int getInttest() {
    return this.inttest;
}
java

INTEGER

Possible values: -2147483648 to 2147483647.

Hibernate default mapping

private Integer integertest;
java
@Column(name = "INTEGERTEST")
public Integer getIntegertest() {
    return this.integertest;
}
java

MEDIUMINT

Possible values: -2147483648 to 2147483647.

Hibernate default mapping

private Integer mediuminttest;
java
@Column(name = "MEDIUMINTTEST")
public Integer getMediuminttest() {
    return this.mediuminttest;
}
java

INT4

Possible values: -2147483648 to 2147483647.

Hibernate default mapping

private Integer int4test;
java
@Column(name = "INT4TEST")
public Integer getInt4test() {
    return this.int4test;
}
java

SIGNED

Possible values: -2147483648 to 2147483647.

Hibernate default mapping

private Integer signedtest;
java
@Column(name = "SIGNEDTEST")
public Integer getSignedtest() {
    return this.signedtest;
}
java

BOOLEAN

Possible values: TRUE and FALSE.

Hibernate default mapping

private Boolean booleantest;
java
@Column(name = "BOOLEANTEST")
public Boolean getBooleantest() {
    return this.booleantest;
}
java

BIT

Possible values: TRUE and FALSE.

Hibernate default mapping

private Boolean bittest;
java
@Column(name = "BITTEST")
public Boolean getBittest() {
    return this.bittest;
}
java

BOOL

Possible values: TRUE and FALSE.

Hibernate default mapping

private Boolean booltest;
java
@Column(name = "BOOLTEST")
public Boolean getBooltest() {
    return this.booltest;
}
java

TINYINT

Possible values: -128 to 127.

Hibernate default mapping

private Byte tinyinttest;
java
@Column(name = "TINYINTTEST")
public Byte getTinyinttest() {
    return this.tinyinttest;
}
java

SMALLINT

Possible values: -32768 to 32767.

Hibernate default mapping

private Short smallinttest;
java
@Column(name = "SMALLINTTEST")
public Short getSmallinttest() {
    return this.smallinttest;
}
java

INT2

Possible values: -32768 to 32767.

Hibernate default mapping

private Short int2test;
java
@Column(name = "INT2TEST")
public Short getInt2test() {
    return this.int2test;
}
java

YEAR

Possible values: -32768 to 32767.

Hibernate default mapping

private Short yeartest;
java
@Column(name = "YEARTEST")
public Short getYeartest() {
    return this.yeartest;
}
java

BIGINT

Possible values: -9223372036854775808 to 9223372036854775807.

Hibernate default mapping

private Long biginttest;
java
@Column(name = "BIGINTTEST")
public Long getBiginttest() {
    return this.biginttest;
}
java

INT8

Possible values: -9223372036854775808 to 9223372036854775807.

Hibernate default mapping

private Long int8test;
java
@Column(name = "INT8TEST")
public Long getInt8test() {
    return this.int8test;
}
java

IDENTITY

Auto-Increment value. Possible values: -9223372036854775808 to 9223372036854775807.

Used values are never re-used, even when the transaction is rolled back.

Hibernate default mapping

private Long identitytest;
java
@GeneratedValue(strategy = IDENTITY)
@Column(name = "IDENTITYTEST",  unique = true,
            nullable = false)
public Long getIdentitytest() {
    return this.identitytest;
}
java

DECIMAL

Data type with fixed precision and scale.

This data type is recommended for storing currency values.

Hibernate default mapping

private BigDecimal decimaltest;
java
@Column(name = "DECIMALTEST", precision = 20)
public BigDecimal getDecimaltest() {
    return this.decimaltest;
}
java
private Double decimaltest;
java
@Column(name = "DECIMALTEST", precision = 20)
public Double getDecimaltest() {
    return this.decimaltest;
}
java

NUMBER

Data type with fixed precision and scale.

This data type is recommended for storing currency values.

Hibernate default mapping

private BigDecimal numbertest;
java
@Column(name = "NUMBERTEST", precision = 20)
public BigDecimal getNumbertest() {
    return this.numbertest;
}
java

DEC

Data type with fixed precision and scale.

This data type is recommended for storing currency values.

Hibernate default mapping

private BigDecimal dectest;
java
@Column(name = "DECTEST", precision = 20)
public BigDecimal getDectest() {
    return this.dectest;
}
java

NUMERIC

Data type with fixed precision and scale.

This data type is recommended for storing currency values.

Hibernate default mapping

private BigDecimal numerictest;
java
@Column(name = "NUMERICTEST", precision = 20)
public BigDecimal getNumerictest() {
    return this.numerictest;
}
java

DOUBLE

A floating point number. Should not be used to represent currency values, because of rounding problems.

Hibernate default mapping

private Double doubletest;
java
@Column(name = "DOUBLETEST", precision = 17,
            scale = 0)
public Double getDoubletest() {
    return this.doubletest;
}
java

FLOAT

A floating point number. Should not be used to represent currency values, because of rounding problems.

Hibernate default mapping

private Double floattest;
java
@Column(name = "FLOATTEST", precision = 17,
            scale = 0)
public Double getFloattest() {
    return this.floattest;
}
java

FLOAT8

A floating point number. Should not be used to represent currency values, because of rounding problems.

Hibernate default mapping

private Double float8test;
java
@Column(name = "FLOAT8TEST", precision = 17,
            scale = 0)
public Double getFloat8test() {
    return this.float8test;
}
java

REAL

A single precision floating point number. Should not be used to represent currency values, because of rounding problems.

visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"REAL"},
        new String[]{"java.lang.Float","float"},"real"));
java
private Float realtest;
java
@Column(name = "REALTEST", precision = 7,
            scale = 0, columnDefinition = "real")
public Float getRealtest() {
    return this.realtest;
}
java

FLOAT4

A single precision floating point number. Should not be used to represent currency values, because of rounding problems.

visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"REAL"},
            new String[]{"java.lang.Float","float"},"real"));
java
private Float float4test;
java
@Column(name = "FLOAT4TEST", precision = 7,
            scale = 0, columnDefinition = "real")
public Float getFloat4test() {
    return this.float4test;
}
java

TIME

The time data type. The format is hh:mm:ss.

Hibernate default mapping

private Date timetest;
java
@Temporal(TemporalType.TIME)
@Column(name = "TIMETEST", length = 6)
public Date getTimetest() {
    return this.timetest;
}
java

DATE

The date data type. The format is yyyy-MM-dd.

Hibernate default mapping

private Date datetest;
java
@Temporal(TemporalType.DATE)
@Column(name = "DATETEST", length = 8)
public Date getDatetest() {
    return this.datetest;
}
java

TIMESTAMP

The timestamp data type.

The format is yyyy-MM-dd hh:mm:ss[.nnnnnnn].

Hibernate default mapping

private Date timestamptest;
java
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "TIMESTAMPTEST", length = 23)
public Date getTimestamptest() {
    return this.timestamptest;
}
java

DATETIME

The timestamp data type.

The format is yyyy-MM-dd hh:mm:ss[.nnnnnnn].

Hibernate default mapping

private Date datetimetest;
java
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DATETIMETEST", length = 23)
public Date getDatetimetest() {
    return this.datetimetest;
}
java

SMALLDATETIME

The timestamp data type.

The format is yyyy-MM-dd hh:mm:ss[.nnnnnnn].

Hibernate default mapping

private Date smalldatetimetest;
java
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "SMALLDATETIMETEST", length = 23)
public Date getSmalldatetimetest() {
    return this.smalldatetimetest;
}
java

BINARY

Represents a byte array. For very long arrays, use BLOB.

The maximum size is 2 GB, but the whole object is kept in memory when using this data type. The precision is a size constraint; only the actual data is persisted. For large text data BLOB or CLOB should be used.

Hibernate default mapping

private byte[] binarytest;
java
@Column(name = "BINARYTEST")
public byte[] getBinarytest() {
    return this.binarytest;
}
java

VARBINARY

Represents a byte array. For very long arrays, use BLOB.

The maximum size is 2 GB, but the whole object is kept in memory when using this data type. The precision is a size constraint; only the actual data is persisted. For large text data BLOB or CLOB should be used.

Hibernate default mapping

private byte[] varbinarytest;
java
@Column(name = "VARBINARYTEST")
public byte[] getVarbinarytest() {
    return this.varbinarytest;
}
java

LONGVARBINARY

Represents a byte array. For very long arrays, use BLOB.

The maximum size is 2 GB, but the whole object is kept in memory when using this data type. The precision is a size constraint; only the actual data is persisted. For large text data BLOB or CLOB should be used.

Hibernate default mapping

private byte[] longvarbinarytest;
java
@Column(name = "LONGVARBINARYTEST")
public byte[] getLongvarbinarytest() {
    return this.longvarbinarytest;
}
java

RAW

Represents a byte array. For very long arrays, use BLOB.

The maximum size is 2 GB, but the whole object is kept in memory when using this data type. The precision is a size constraint; only the actual data is persisted. For large text data BLOB or CLOB should be used.

Hibernate default mapping

private byte[] rawtest;
java
@Column(name = "RAWTEST")
public byte[] getRawtest() {
    return this.rawtest;
}
java

BYTEA

Represents a byte array. For very long arrays, use BLOB.

The maximum size is 2 GB, but the whole object is kept in memory when using this data type. The precision is a size constraint; only the actual data is persisted. For large text data BLOB or CLOB should be used.

Hibernate default mapping

private byte[] byteatest;
java
@Column(name = "BYTEATEST")
public byte[] getByteatest() {
    return this.byteatest;
}
java

VARCHAR

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String varchartest;
java
@Column(name = "VARCHARTEST")
public String getVarchartest() {
    return this.varchartest;
}
java

LONGVARCHAR

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String longvarchartest;
java
@Column(name = "LONGVARCHARTEST")
public String getLongvarchartest() {
    return this.longvarchartest;
}
java

VARCHAR2

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String varchar2test;
java
@Column(name = "VARCHAR2TEST")
public String getVarchar2test() {
    return this.varchar2test;
}
java

NVARCHAR

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String nvarchartest;
java
@Column(name = "NVARCHARTEST")
public String getNvarchartest() {
    return this.nvarchartest;
}
java

NVARCHAR2

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String nvarchar2test;
java
@Column(name = "NVARCHAR2TEST")
public String getNvarchar2test() {
    return this.nvarchar2test;
}
java

VARCHARCASESENSITIVE

A Unicode string. Use two single quotes ('') to create a quote.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.

The whole text is loaded into memory when using this data type. For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String varcharCasesensitivetest;
java
@Column(name = "VARCHAR_CASESENSITIVETEST")
public String getVarcharCasesensitivetest() {
    return this.varcharCasesensitivetest;
}
java

VARCHARIGNORECASE

Same as VARCHAR, but not case-sensitive when comparing.

Stored in mixed case.The maximum precision is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is persisted.The whole text is loaded into memory when using this data type.

For large text data CLOB should be used; see there for details.

Hibernate default mapping

private String varcharIgnorecasetest;
java
@Column(name = "VARCHAR_IGNORECASETEST")
public String getVarcharIgnorecasetest() {
    return this.varcharIgnorecasetest;
}
java

BLOB

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] blobtest;
java
@Lob
@Column(name = "BLOBTEST", columnDefinition = "blob")
public byte[] getBlobtest() {
    return this.blobtest;
}
java

TINYBLOB

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] tinyblobtest;
java
@Lob
@Column(name = "TINYBLOBTEST", columnDefinition = "blob")
public byte[] getTinyblobtest() {
    return this.tinyblobtest;
}
java

MEDIUMBLOB

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] mediumblobtest;
java
@Lob
@Column(name = "MEDIUMBLOBTEST", columnDefinition = "blob")
public byte[] getMediumblobtest() {
    return this.mediumblobtest;
}
java

LONGBLOB

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] longblobtest;
java
@Lob
@Column(name = "LONGBLOBTEST", columnDefinition = "blob")
public byte[] getLongblobtest() {
    return this.longblobtest;
}
java

IMAGE

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] imagetest;
java
@Lob
@Column(name = "IMAGETEST", columnDefinition = "blob")
public byte[] getImagetest() {
    return this.imagetest;
}
java

OID

Like BINARY, but intended for very large values such as files or images. Unlike when using BINARY, large objects are not kept fully in-memory. Use PreparedStatement.setBinaryStream to store values.See also CLOB and Advanced / Large Objects.

<sql-type jdbc-type="BLOB" hibernate-type="byte[]"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"BLOB"},new String[]
        {"byte[]"},"blob").addLobAnnotation());
java
private byte[] oidtest;
java
@Lob
@Column(name = "OIDTEST", columnDefinition = "blob")
public byte[] getOidtest() {
    return this.oidtest;
}
java

CLOB

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String clobtest;
java
@Lob
@Column(name = "CLOBTEST", columnDefinition = "clob")
public String getClobtest() {
    return this.clobtest;
}
java

TINYTEXT

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String tinytexttest;
java
@Lob
@Column(name = "TINYTEXTTEST", columnDefinition = "clob")
public String getTinytexttest() {
    return this.tinytexttest;
}
java

TEXT

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String texttest;
java
@Lob
@Column(name = "TEXTTEST", columnDefinition = "clob")
public String getTexttest() {
    return this.texttest;
}
java

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String mediumtexttest;
java
@Lob
@Column(name = "MEDIUMTEXTTEST", columnDefinition = "clob")
public String getMediumtexttest() {
    return this.mediumtexttest;
}
java

LONG TEXT

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String longtexttest;
java
@Lob
@Column(name = "LONGTEXTTEST", columnDefinition = "clob")
public String getLongtexttest() {
    return this.longtexttest;
}
java

NTEXT

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String ntexttest;
java
@Lob
@Column(name = "NTEXTTEST", columnDefinition = "clob")
public String getNtexttest() {
    return this.ntexttest;
}
java

NCLOB

CLOB is like VARCHAR, but intended for very large values.

Unlike when using VARCHAR, large CLOB are not kept fully in-memory; instead, they are streamed. CLOB should be used for documents and texts with arbitrary size such as XML or HTML documents, text files, or memo fields of unlimited size.

Use PreparedStatment.setCharacterStream to store values.

VARCHAR should be used for text with relatively short average size (for example shorter than 200 characters). Short CLOB values are stored inline, but there is an overhead compared to VARCHAR.

<sql-type jdbc-type="CLOB" hibernate-type="java.lang.String"></sql-type>
java
visitor.addPropertyColumnDefinitionFix(
    new PropertyColumnDefinitionFix(new String[]{"CLOB"},
        new String[]{"java.lang.String"},"clob").addLobAnnotation());
java
private String nclobtest;
java
@Lob
@Column(name = "NCLOBTEST", columnDefinition = "clob")
public String getNclobtest() {
    return this.nclobtest;
}
java