Package net.solarnetwork.node.dao.jdbc
Class ColumnCsvMetaData
java.lang.Object
net.solarnetwork.node.dao.jdbc.ColumnCsvMetaData
Metadata about a JDBC table column for use in CSV processing.
- Since:
- 1.17
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionColumnCsvMetaData(String columnName, org.supercsv.cellprocessor.ift.CellProcessor cellProcessor, int sqlType) Construct as a non-primary key column.ColumnCsvMetaData(String columnName, org.supercsv.cellprocessor.ift.CellProcessor cellProcessor, int sqlType, boolean primaryKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet a copy of this object with the primary key flag set totrue.org.supercsv.cellprocessor.ift.CellProcessorGet aCellProcessorto use with the associated CSV conversion.Get the JDBC column name.intGet the JDBC column type, from theTypesclass.booleanFlag if this column is part of the table's primary key.
-
Constructor Details
-
ColumnCsvMetaData
public ColumnCsvMetaData(String columnName, org.supercsv.cellprocessor.ift.CellProcessor cellProcessor, int sqlType) Construct as a non-primary key column.- Parameters:
columnName- The column name.cellProcessor- The cell processor to use when parsing CSV data for this column.sqlType- The JDBCTypesvalue to use for this column.
-
ColumnCsvMetaData
public ColumnCsvMetaData(String columnName, org.supercsv.cellprocessor.ift.CellProcessor cellProcessor, int sqlType, boolean primaryKey) Constructor.- Parameters:
columnName- The column name.cellProcessor- The cell processor to use when parsing CSV data for this column.sqlType- The JDBCTypesvalue to use for this column.primaryKey-trueif this is a primary key column.
-
-
Method Details
-
getColumnName
Get the JDBC column name.- Returns:
- The column name.
-
getCellProcessor
public org.supercsv.cellprocessor.ift.CellProcessor getCellProcessor()Get aCellProcessorto use with the associated CSV conversion.- Returns:
- A cell processor.
-
getSqlType
public int getSqlType()Get the JDBC column type, from theTypesclass.- Returns:
- The JDBC column type.
-
isPrimaryKey
public boolean isPrimaryKey()Flag if this column is part of the table's primary key.- Returns:
trueif part of the table's primary key.
-
asPrimaryKeyColumn
Get a copy of this object with the primary key flag set totrue.- Returns:
- A new column metadata instance.
-