[#1308] Oracle's DataTypeDefinition reports the length of a BLOB / CLOB data type to be 4000
This commit is contained in:
parent
cee7e5c1fb
commit
7f48be5af3
@ -36,6 +36,8 @@
|
||||
|
||||
package org.jooq.util.oracle;
|
||||
|
||||
import static org.jooq.impl.Factory.decode;
|
||||
import static org.jooq.impl.Factory.inline;
|
||||
import static org.jooq.util.oracle.sys.Tables.ALL_COL_COMMENTS;
|
||||
import static org.jooq.util.oracle.sys.Tables.ALL_TAB_COLS;
|
||||
|
||||
@ -66,7 +68,10 @@ public class OracleTableDefinition extends AbstractTableDefinition {
|
||||
|
||||
for (Record record : create().select(
|
||||
ALL_TAB_COLS.DATA_TYPE,
|
||||
ALL_TAB_COLS.DATA_LENGTH,
|
||||
decode(ALL_TAB_COLS.DATA_TYPE.upper(),
|
||||
"CLOB", inline(0),
|
||||
"BLOB", inline(0),
|
||||
ALL_TAB_COLS.DATA_LENGTH).as("data_length"),
|
||||
ALL_TAB_COLS.DATA_PRECISION,
|
||||
ALL_TAB_COLS.DATA_SCALE,
|
||||
ALL_TAB_COLS.NULLABLE,
|
||||
@ -87,7 +92,7 @@ public class OracleTableDefinition extends AbstractTableDefinition {
|
||||
getDatabase(),
|
||||
getSchema(),
|
||||
record.getValue(ALL_TAB_COLS.DATA_TYPE),
|
||||
record.getValueAsInteger(ALL_TAB_COLS.DATA_LENGTH, 0),
|
||||
record.getValueAsInteger("data_length", 0),
|
||||
record.getValueAsInteger(ALL_TAB_COLS.DATA_PRECISION, 0),
|
||||
record.getValueAsInteger(ALL_TAB_COLS.DATA_SCALE, 0));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.multi_schema.tables.pojos;
|
||||
@javax.persistence.Table(name = "T_BOOK", schema = "MULTI_SCHEMA")
|
||||
public class TBook implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = 986192358;
|
||||
private static final long serialVersionUID = 1604287607;
|
||||
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
@ -30,8 +30,6 @@ public class TBook implements java.io.Serializable {
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
private org.jooq.test.oracle.generatedclasses.test.enums.TLanguage languageId;
|
||||
|
||||
@javax.validation.constraints.Size(max = 4000)
|
||||
private java.lang.String contentText;
|
||||
private byte[] contentPdf;
|
||||
|
||||
@ -99,7 +97,7 @@ public class TBook implements java.io.Serializable {
|
||||
this.languageId = languageId;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return this.contentText;
|
||||
}
|
||||
@ -108,7 +106,7 @@ public class TBook implements java.io.Serializable {
|
||||
this.contentText = contentText;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return this.contentPdf;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.multi_schema.tables.records;
|
||||
@javax.persistence.Table(name = "T_BOOK", schema = "MULTI_SCHEMA")
|
||||
public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test.oracle.generatedclasses.multi_schema.tables.records.TBookRecord> {
|
||||
|
||||
private static final long serialVersionUID = 679491786;
|
||||
private static final long serialVersionUID = -785867012;
|
||||
|
||||
/**
|
||||
* An uncommented item
|
||||
@ -200,7 +200,7 @@ public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test
|
||||
/**
|
||||
* An uncommented item
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.multi_schema.tables.TBook.T_BOOK.CONTENT_TEXT);
|
||||
}
|
||||
@ -215,7 +215,7 @@ public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test
|
||||
/**
|
||||
* An uncommented item
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.multi_schema.tables.TBook.T_BOOK.CONTENT_PDF);
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.pojos;
|
||||
@javax.persistence.Table(name = "T_BOOK", schema = "TEST")
|
||||
public class TBook implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = 401057363;
|
||||
private static final long serialVersionUID = -363111510;
|
||||
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
@ -32,8 +32,6 @@ public class TBook implements java.io.Serializable {
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
private org.jooq.test.oracle.generatedclasses.test.enums.TLanguage languageId;
|
||||
|
||||
@javax.validation.constraints.Size(max = 4000)
|
||||
private java.lang.String contentText;
|
||||
private byte[] contentPdf;
|
||||
|
||||
@ -101,7 +99,7 @@ public class TBook implements java.io.Serializable {
|
||||
this.languageId = languageId;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return this.contentText;
|
||||
}
|
||||
@ -110,7 +108,7 @@ public class TBook implements java.io.Serializable {
|
||||
this.contentText = contentText;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return this.contentPdf;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.pojos;
|
||||
@javax.persistence.Table(name = "T_725_LOB_TEST", schema = "TEST")
|
||||
public class T_725LobTest implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = -55337956;
|
||||
private static final long serialVersionUID = 1487073019;
|
||||
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
@ -27,7 +27,7 @@ public class T_725LobTest implements java.io.Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "LOB", length = 4000)
|
||||
@javax.persistence.Column(name = "LOB")
|
||||
public byte[] getLob() {
|
||||
return this.lob;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.pojos;
|
||||
@javax.persistence.Table(name = "V_BOOK", schema = "TEST")
|
||||
public class VBook implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1737200263;
|
||||
private static final long serialVersionUID = 1794034790;
|
||||
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
@ -30,8 +30,6 @@ public class VBook implements java.io.Serializable {
|
||||
|
||||
@javax.validation.constraints.NotNull
|
||||
private java.lang.Integer languageId;
|
||||
|
||||
@javax.validation.constraints.Size(max = 4000)
|
||||
private java.lang.String contentText;
|
||||
private byte[] contentPdf;
|
||||
|
||||
@ -98,7 +96,7 @@ public class VBook implements java.io.Serializable {
|
||||
this.languageId = languageId;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return this.contentText;
|
||||
}
|
||||
@ -107,7 +105,7 @@ public class VBook implements java.io.Serializable {
|
||||
this.contentText = contentText;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return this.contentPdf;
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.records;
|
||||
@javax.persistence.Table(name = "T_BOOK", schema = "TEST")
|
||||
public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test.oracle.generatedclasses.test.tables.records.TBookRecord> {
|
||||
|
||||
private static final long serialVersionUID = 777547931;
|
||||
private static final long serialVersionUID = -1497888887;
|
||||
|
||||
/**
|
||||
* The book ID
|
||||
@ -214,7 +214,7 @@ public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test
|
||||
/**
|
||||
* Some textual content of the book
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.test.tables.TBook.T_BOOK.CONTENT_TEXT);
|
||||
}
|
||||
@ -229,7 +229,7 @@ public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test
|
||||
/**
|
||||
* Some binary content of the book
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.test.tables.TBook.T_BOOK.CONTENT_PDF);
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.records;
|
||||
@javax.persistence.Table(name = "T_725_LOB_TEST", schema = "TEST")
|
||||
public class T_725LobTestRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test.oracle.generatedclasses.test.tables.records.T_725LobTestRecord> {
|
||||
|
||||
private static final long serialVersionUID = -1886427352;
|
||||
private static final long serialVersionUID = 1892541915;
|
||||
|
||||
/**
|
||||
* An uncommented item
|
||||
@ -42,7 +42,7 @@ public class T_725LobTestRecord extends org.jooq.impl.UpdatableRecordImpl<org.jo
|
||||
/**
|
||||
* An uncommented item
|
||||
*/
|
||||
@javax.persistence.Column(name = "LOB", length = 4000)
|
||||
@javax.persistence.Column(name = "LOB")
|
||||
public byte[] getLob() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.test.tables.T_725LobTest.T_725_LOB_TEST.LOB);
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle.generatedclasses.test.tables.records;
|
||||
@javax.persistence.Table(name = "V_BOOK", schema = "TEST")
|
||||
public class VBookRecord extends org.jooq.impl.TableRecordImpl<org.jooq.test.oracle.generatedclasses.test.tables.records.VBookRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1646329168;
|
||||
private static final long serialVersionUID = -430542554;
|
||||
|
||||
/**
|
||||
* An uncommented item
|
||||
@ -127,7 +127,7 @@ public class VBookRecord extends org.jooq.impl.TableRecordImpl<org.jooq.test.ora
|
||||
/**
|
||||
* An uncommented item
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getContentText() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.test.tables.VBook.V_BOOK.CONTENT_TEXT);
|
||||
}
|
||||
@ -142,7 +142,7 @@ public class VBookRecord extends org.jooq.impl.TableRecordImpl<org.jooq.test.ora
|
||||
/**
|
||||
* An uncommented item
|
||||
*/
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getContentPdf() {
|
||||
return getValue(org.jooq.test.oracle.generatedclasses.test.tables.VBook.V_BOOK.CONTENT_PDF);
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle3.generatedclasses.tables.pojos;
|
||||
@javax.persistence.Table(name = "T_725_LOB_TEST", schema = "TEST")
|
||||
public class T_725_LOB_TEST_POJO extends java.lang.ThreadDeath implements java.lang.Cloneable {
|
||||
|
||||
private static final long serialVersionUID = -744225301;
|
||||
private static final long serialVersionUID = -1890033140;
|
||||
|
||||
private java.lang.Integer ID;
|
||||
private byte[] LOB;
|
||||
@ -25,7 +25,7 @@ public class T_725_LOB_TEST_POJO extends java.lang.ThreadDeath implements java.l
|
||||
this.ID = ID;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "LOB", length = 4000)
|
||||
@javax.persistence.Column(name = "LOB")
|
||||
public byte[] getLOB() {
|
||||
return this.LOB;
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ package org.jooq.test.oracle3.generatedclasses.tables.pojos;
|
||||
@javax.persistence.Table(name = "T_BOOK", schema = "TEST")
|
||||
public class T_BOOK_POJO extends java.lang.Object implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1535487354;
|
||||
private static final long serialVersionUID = 1472334274;
|
||||
|
||||
private java.lang.Integer ID;
|
||||
private java.lang.Integer AUTHOR_ID;
|
||||
@ -88,7 +88,7 @@ public class T_BOOK_POJO extends java.lang.Object implements java.io.Serializabl
|
||||
this.LANGUAGE_ID = LANGUAGE_ID;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getCONTENT_TEXT() {
|
||||
return this.CONTENT_TEXT;
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class T_BOOK_POJO extends java.lang.Object implements java.io.Serializabl
|
||||
this.CONTENT_TEXT = CONTENT_TEXT;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getCONTENT_PDF() {
|
||||
return this.CONTENT_PDF;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ package org.jooq.test.oracle3.generatedclasses.tables.pojos;
|
||||
@javax.persistence.Table(name = "V_BOOK", schema = "TEST")
|
||||
public class V_BOOK_POJO extends java.lang.Object implements java.io.Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1669816530;
|
||||
private static final long serialVersionUID = -911235302;
|
||||
|
||||
private java.lang.Integer ID;
|
||||
private java.lang.Integer AUTHOR_ID;
|
||||
@ -85,7 +85,7 @@ public class V_BOOK_POJO extends java.lang.Object implements java.io.Serializabl
|
||||
this.LANGUAGE_ID = LANGUAGE_ID;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_TEXT")
|
||||
public java.lang.String getCONTENT_TEXT() {
|
||||
return this.CONTENT_TEXT;
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class V_BOOK_POJO extends java.lang.Object implements java.io.Serializabl
|
||||
this.CONTENT_TEXT = CONTENT_TEXT;
|
||||
}
|
||||
|
||||
@javax.persistence.Column(name = "CONTENT_PDF", length = 4000)
|
||||
@javax.persistence.Column(name = "CONTENT_PDF")
|
||||
public byte[] getCONTENT_PDF() {
|
||||
return this.CONTENT_PDF;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user