本文整理汇总了Java中org.pentaho.di.core.database.DatabaseMeta.CLOB_LENGTH属性的典型用法代码示例。如果您正苦于以下问题:Java DatabaseMeta.CLOB_LENGTH属性的具体用法?Java DatabaseMeta.CLOB_LENGTH怎么用?Java DatabaseMeta.CLOB_LENGTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.pentaho.di.core.database.DatabaseMeta
的用法示例。
在下文中一共展示了DatabaseMeta.CLOB_LENGTH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldDefinition
@Override
public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
boolean add_fieldname, boolean add_cr ) {
String retval = "";
String fieldname = v.getName();
int length = v.getLength();
int precision = v.getPrecision();
if ( add_fieldname ) {
retval += fieldname + " ";
}
int type = v.getType();
switch ( type ) {
case ValueMetaInterface.TYPE_DATE:
retval += "TIMESTAMP";
break;
case ValueMetaInterface.TYPE_BOOLEAN:
if ( supportsBooleanDataType() ) {
retval += "BOOLEAN";
} else {
retval += "CHAR(1)";
}
break;
case ValueMetaInterface.TYPE_NUMBER:
case ValueMetaInterface.TYPE_INTEGER:
case ValueMetaInterface.TYPE_BIGNUMBER:
if ( fieldname.equalsIgnoreCase( tk ) || // Technical key
fieldname.equalsIgnoreCase( pk ) // Primary key
) {
retval += "BIGSERIAL";
} else {
if ( length > 0 ) {
if ( precision > 0 || length > 18 ) {
// Numeric(Precision, Scale): Precision = total length; Scale = decimal places
retval += "NUMERIC(" + ( length + precision ) + ", " + precision + ")";
} else {
if ( length > 9 ) {
retval += "BIGINT";
} else {
if ( length < 5 ) {
retval += "SMALLINT";
} else {
retval += "INTEGER";
}
}
}
} else {
retval += "DOUBLE PRECISION";
}
}
break;
case ValueMetaInterface.TYPE_STRING:
if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) {
retval += "TEXT";
} else {
retval += "VARCHAR(" + length + ")";
}
break;
default:
retval += " UNKNOWN";
break;
}
if ( add_cr ) {
retval += Const.CR;
}
return retval;
}
示例2: getFieldDefinition
@Override
public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
boolean add_fieldname, boolean add_cr ) {
// TODO override for your types
String retval = "";
String fieldname = v.getName();
int length = v.getLength();
int precision = v.getPrecision();
if ( add_fieldname ) {
retval += fieldname + " ";
}
int type = v.getType();
switch ( type ) {
case ValueMetaInterface.TYPE_DATE:
retval += "TIMESTAMP";
break;
case ValueMetaInterface.TYPE_BOOLEAN:
if ( supportsBooleanDataType() ) {
retval += "BOOLEAN";
} else {
retval += "CHAR(1)";
}
break;
case ValueMetaInterface.TYPE_NUMBER:
case ValueMetaInterface.TYPE_INTEGER:
case ValueMetaInterface.TYPE_BIGNUMBER:
if ( fieldname.equalsIgnoreCase( tk ) || // Technical key
fieldname.equalsIgnoreCase( pk ) // Primary key
) {
retval += "BIGSERIAL";
} else {
if ( length > 0 ) {
if ( precision > 0 || length > 18 ) {
// Numeric(Precision, Scale): Precision = total length; Scale = decimal places
retval += "NUMERIC(" + ( length + precision ) + ", " + precision + ")";
} else {
if ( length > 9 ) {
retval += "BIGINT";
} else {
if ( length < 5 ) {
retval += "SMALLINT";
} else {
retval += "INTEGER";
}
}
}
} else {
retval += "DOUBLE PRECISION";
}
}
break;
case ValueMetaInterface.TYPE_STRING:
if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) {
retval += "TEXT";
} else {
retval += "VARCHAR(" + length + ")";
}
break;
default:
retval += " UNKNOWN";
break;
}
if ( add_cr ) {
retval += Const.CR;
}
return retval;
}
示例3: getFieldDefinition
@Override
public String getFieldDefinition ( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
boolean add_fieldname, boolean add_cr ) {
String retval = "";
String fieldname = v.getName ();
int length = v.getLength ();
int precision = v.getPrecision ();
if ( add_fieldname ) {
retval += fieldname + " ";
}
int type = v.getType ();
switch ( type ) {
case ValueMetaInterface.TYPE_DATE:
retval += "TIMESTAMP";
break;
case ValueMetaInterface.TYPE_BOOLEAN:
if ( supportsBooleanDataType () ) {
retval += "BOOLEAN";
} else {
retval += "CHAR(1)";
}
break;
case ValueMetaInterface.TYPE_NUMBER:
case ValueMetaInterface.TYPE_INTEGER:
case ValueMetaInterface.TYPE_BIGNUMBER:
if ( fieldname.equalsIgnoreCase ( tk ) || // Technical key
fieldname.equalsIgnoreCase ( pk ) // Primary key
) {
retval += "BIGSERIAL";
} else {
if ( length > 0 ) {
if ( precision > 0 || length > 18 ) {
// Numeric(Precision, Scale): Precision = total length; Scale = decimal places
retval += "NUMERIC(" + (length + precision) + ", " + precision + ")";
} else {
if ( length > 9 ) {
retval += "BIGINT";
} else {
if ( length < 5 ) {
retval += "SMALLINT";
} else {
retval += "INTEGER";
}
}
}
} else {
retval += "DOUBLE PRECISION";
}
}
break;
case ValueMetaInterface.TYPE_STRING:
if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) {
retval += "TEXT";
} else {
retval += "VARCHAR(" + length + ")";
}
break;
default:
retval += " UNKNOWN";
break;
}
if ( add_cr ) {
retval += Const.CR;
}
return retval;
}