Java Code Examples for org.pentaho.di.core.row.ValueMetaInterface#setOriginalColumnType()
The following examples show how to use
org.pentaho.di.core.row.ValueMetaInterface#setOriginalColumnType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueMetaInternetAddress.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@Override public ValueMetaInterface getMetadataPreview( DatabaseMeta databaseMeta, ResultSet rs ) throws KettleDatabaseException { try { if ( "INET".equalsIgnoreCase( rs.getString( "TYPE_NAME" ) ) ) { ValueMetaInterface vmi = super.getMetadataPreview( databaseMeta, rs ); ValueMetaInterface valueMeta = new ValueMetaInternetAddress( name ); valueMeta.setLength( vmi.getLength() ); valueMeta.setOriginalColumnType( vmi.getOriginalColumnType() ); valueMeta.setOriginalColumnTypeName( vmi.getOriginalColumnTypeName() ); valueMeta.setOriginalNullable( vmi.getOriginalNullable() ); valueMeta.setOriginalPrecision( vmi.getOriginalPrecision() ); valueMeta.setOriginalScale( vmi.getOriginalScale() ); valueMeta.setOriginalSigned( vmi.getOriginalSigned() ); return valueMeta; } } catch ( SQLException e ) { throw new KettleDatabaseException( e ); } return null; }
Example 2
Source File: ValueMetaFactory.java From pentaho-kettle with Apache License 2.0 | 5 votes |
public static void cloneInfo( ValueMetaInterface source, ValueMetaInterface target ) throws KettlePluginException { target.setConversionMask( source.getConversionMask() ); target.setDecimalSymbol( source.getDecimalSymbol() ); target.setGroupingSymbol( source.getGroupingSymbol() ); target.setStorageType( source.getStorageType() ); if ( source.getStorageMetadata() != null ) { target.setStorageMetadata( cloneValueMeta( source.getStorageMetadata(), source .getStorageMetadata().getType() ) ); } target.setStringEncoding( source.getStringEncoding() ); target.setTrimType( source.getTrimType() ); target.setDateFormatLenient( source.isDateFormatLenient() ); target.setDateFormatLocale( source.getDateFormatLocale() ); target.setDateFormatTimeZone( source.getDateFormatTimeZone() ); target.setLenientStringToNumber( source.isLenientStringToNumber() ); target.setLargeTextField( source.isLargeTextField() ); target.setComments( source.getComments() ); target.setCaseInsensitive( source.isCaseInsensitive() ); target.setCollatorDisabled( source.isCollatorDisabled() ); target.setCollatorStrength( source.getCollatorStrength() ); target.setIndex( source.getIndex() ); target.setOrigin( source.getOrigin() ); target.setOriginalAutoIncrement( source.isOriginalAutoIncrement() ); target.setOriginalColumnType( source.getOriginalColumnType() ); target.setOriginalColumnTypeName( source.getOriginalColumnTypeName() ); target.setOriginalNullable( source.isOriginalNullable() ); target.setOriginalPrecision( source.getOriginalPrecision() ); target.setOriginalScale( source.getOriginalScale() ); target.setOriginalSigned( source.isOriginalSigned() ); }
Example 3
Source File: ValueMetaTimestamp.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@Override public ValueMetaInterface getMetadataPreview( DatabaseMeta databaseMeta, ResultSet rs ) throws KettleDatabaseException { try { if ( java.sql.Types.TIMESTAMP == rs.getInt( "COLUMN_TYPE" ) ) { ValueMetaInterface vmi = super.getMetadataPreview( databaseMeta, rs ); ValueMetaInterface valueMeta; if ( databaseMeta.supportsTimestampDataType() ) { valueMeta = new ValueMetaTimestamp( name ); } else { valueMeta = new ValueMetaDate( name ); } valueMeta.setLength( vmi.getLength() ); valueMeta.setOriginalColumnType( vmi.getOriginalColumnType() ); valueMeta.setOriginalColumnTypeName( vmi.getOriginalColumnTypeName() ); valueMeta.setOriginalNullable( vmi.getOriginalNullable() ); valueMeta.setOriginalPrecision( vmi.getOriginalPrecision() ); valueMeta.setOriginalScale( vmi.getOriginalScale() ); valueMeta.setOriginalSigned( vmi.getOriginalSigned() ); return valueMeta; } } catch ( SQLException e ) { throw new KettleDatabaseException( e ); } return null; }
Example 4
Source File: ValueMetaBase.java From pentaho-kettle with Apache License 2.0 | 4 votes |
protected void getOriginalColumnMetadata( ValueMetaInterface v, ResultSetMetaData rm, int index, boolean ignoreLength ) throws SQLException { // Grab the comment as a description to the field as well. String comments = rm.getColumnLabel( index ); v.setComments( comments ); // get & store more result set meta data for later use int originalColumnType = rm.getColumnType( index ); v.setOriginalColumnType( originalColumnType ); String originalColumnTypeName = rm.getColumnTypeName( index ); v.setOriginalColumnTypeName( originalColumnTypeName ); int originalPrecision = -1; if ( !ignoreLength ) { // Throws exception on MySQL originalPrecision = rm.getPrecision( index ); } v.setOriginalPrecision( originalPrecision ); int originalScale = rm.getScale( index ); v.setOriginalScale( originalScale ); // DISABLED FOR PERFORMANCE REASONS : PDI-1788 // // boolean originalAutoIncrement=rm.isAutoIncrement(index); DISABLED FOR // PERFORMANCE REASONS : PDI-1788 // v.setOriginalAutoIncrement(originalAutoIncrement); // int originalNullable=rm.isNullable(index); DISABLED FOR PERFORMANCE // REASONS : PDI-1788 // v.setOriginalNullable(originalNullable); // boolean originalSigned = false; try { originalSigned = rm.isSigned( index ); } catch ( Exception ignored ) { // This JDBC Driver doesn't support the isSigned method. // Nothing more we can do here. } v.setOriginalSigned( originalSigned ); }