Class CellContentConverter
java.lang.Object
net.sf.jailer.util.CellContentConverter
Converts a cell-content to valid SQL-literal.
- Author:
- Ralf Wisser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassWraps a DATETIMEOFFSET value (Microsoft SQL Server specific).static classWraps a national character (NCHAR/NVARCHAR) string value.static classWraps a PostgreSQL object value together with its type name.classWraps a database value together with a type and conversion pattern to produce a SQL expression.static classATimestampsubclass that preserves nanosecond precision. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]All hex digits.static final int -
Constructor Summary
ConstructorsConstructorDescriptionCellContentConverter(ResultSetMetaData resultSetMetaData, Session session, DBMS targetConfiguration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets object from result-set.Gets object from result-set.static StringgetSmallLob(Object lob, DBMS targetConfiguration, Integer maxBlobLength, Integer maxClobLength) Gets SQL expression for a C/BLOB for small LOBS.getSmallLob(ResultSet resultSet, int i) Gets SQL expression for a C/BLOB for small LOBS.static booleanisPostgresObjectType(String columnTypeName) Checks whether the given column type name is a PostgreSQL object type.static StringprepareForComparison(Session session, Column column) Returns a SQL expression for a column that can be used in a comparison, applying any necessary type cast for DBMS-specific non-comparable types.Converts a cell-content to valid SQL-literal.
-
Field Details
-
TIMESTAMP_WITH_NANO
public static final int TIMESTAMP_WITH_NANO- See Also:
-
hexChar
public static final char[] hexCharAll hex digits.
-
-
Constructor Details
-
CellContentConverter
public CellContentConverter(ResultSetMetaData resultSetMetaData, Session session, DBMS targetConfiguration) Constructor.- Parameters:
resultSetMetaData- meta data of the result set to read fromsession- database sessiontargetConfiguration- configuration of the target DBMS
-
-
Method Details
-
toSql
-
getObject
Gets object from result-set.- Parameters:
resultSet- result-seti- column index- Returns:
- object
- Throws:
SQLException
-
isPostgresObjectType
Checks whether the given column type name is a PostgreSQL object type.- Parameters:
columnTypeName- the column type name to check- Returns:
trueif the type is a known PostgreSQL object type
-
getObject
Gets object from result-set.- Parameters:
resultSet- result-setcolumnName- column name- Returns:
- the object
- Throws:
SQLException
-
getSmallLob
-
getSmallLob
-
prepareForComparison
Returns a SQL expression for a column that can be used in a comparison, applying any necessary type cast for DBMS-specific non-comparable types.- Parameters:
session- the current database sessioncolumn- the column to prepare- Returns:
- SQL expression for the column suitable for comparison
-