- status: open --> open-fixed
jOOQ models CLOB columns as java.lang.String, as it is hard to get handling of java.sql.Clob right, in client code. Take this sample table:
--------------------------------------------------------------------
CREATE TABLE t_book (
id NUMBER(7) NOT NULL,
author_id NUMBER(7) NOT NULL,
co_author_id NUMBER(7),
details_id NUMBER(7),
title VARCHAR2(400) NOT NULL,
published_in NUMBER(7) NOT NULL,
language_id NUMBER(7) NOT NULL,
content_text CLOB,
content_pdf BLOB
)
--------------------------------------------------------------------
The content_text field is rendered erroneously as such:
--------------------------------------------------------------------
/**
* CONTENT_TEXT mapping for CONTENT_TEXT
*/
public final TableField<TBookRecord, java.sql.Clob> CONTENT_TEXT = createField("CONTENT_TEXT", org.jooq.impl.SQLDataType.CLOB, this);
--------------------------------------------------------------------
To fix this, JooqUtils should probably have similar treatment of CLOB types in JooqUtils.getJooqColumnFullType() as for BLOB types:
--------------------------------------------------------------------
if (ConvertUtils.DB_BLOB.equals(type) ||
ConvertUtils.DB_LONGVARBINARY.equals(type) ||
ConvertUtils.DB_LONGBLOB.equals(type))
return "byte[]";
// Add something like this:
if (ConvertUtils.DB_CLOB.equals(type) ||
ConvertUtils.DB_LONGTEXT.equals(type))
return "java.lang.String";
--------------------------------------------------------------------
--------------------------------------------------------------------