Package org.pjdbc.sql

Class AbstractJdbcTransformer

java.lang.Object
org.pjdbc.sql.AbstractJdbcTransformer
All Implemented Interfaces:
JdbcTransformer
Direct Known Subclasses:
CompositeTransformer, RenameTransformer, SchemaTransformer, WhereTransformer

public abstract class AbstractJdbcTransformer extends Object implements JdbcTransformer
Base implementation of JdbcTransformer that performs no transformation. Subclass and override specific methods to add transformation behavior. This class provides identity transformations (returns input unchanged) for all transformation methods, making it easy to implement transformers that only need to transform certain aspects of JDBC operations.
  • Constructor Details

    • AbstractJdbcTransformer

      public AbstractJdbcTransformer()
  • Method Details

    • transformSql

      public String transformSql(String sql) throws SQLException
      Default implementation returns SQL unchanged.
      Specified by:
      transformSql in interface JdbcTransformer
      Parameters:
      sql - Original SQL string
      Returns:
      Transformed SQL string
      Throws:
      SQLException - if transformation fails
    • transformParameter

      public Object transformParameter(int parameterIndex, Object value, int sqlType) throws SQLException
      Default implementation returns parameter value unchanged.
      Specified by:
      transformParameter in interface JdbcTransformer
      Parameters:
      parameterIndex - 1-based parameter index
      value - Original parameter value
      sqlType - SQL type from java.sql.Types
      Returns:
      Transformed parameter value
      Throws:
      SQLException - if transformation fails
    • transformResultValue

      public Object transformResultValue(int columnIndex, String columnName, Object value, int sqlType) throws SQLException
      Default implementation returns result value unchanged.
      Specified by:
      transformResultValue in interface JdbcTransformer
      Parameters:
      columnIndex - 1-based column index
      columnName - Column name (may be null if not available)
      value - Original value from ResultSet
      sqlType - SQL type from java.sql.Types
      Returns:
      Transformed value
      Throws:
      SQLException - if transformation fails