本文整理匯總了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;
}