java.lang.Object
org.odpi.openmetadata.adapters.connectors.resource.jdbc.mappers.BaseMapper
Direct Known Subclasses:
ControlMapper, RepositoryMapper

public class BaseMapper extends Object
Common routines used by the mappers
  • Constructor Details

    • BaseMapper

      public BaseMapper(String connectorName)
      Constructor ensures there is a connector name for error messages.
      Parameters:
      connectorName - connector name
  • Method Details

    • getStringPropertyFromColumn

      public String getStringPropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a string value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • getStringArrayPropertyFromColumn

      public List<String> getStringArrayPropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a string value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • getSerializableMapPropertyFromColumn

      public Map<String,Serializable> getSerializableMapPropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a string value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • getDatePropertyFromColumn

      public Date getDatePropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a date value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • getLongPropertyFromColumn

      public long getLongPropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a long value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • getBooleanPropertyFromColumn

      public boolean getBooleanPropertyFromColumn(String columnName, Map<String,JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorException
      Retrieve a date value from a specific column.
      Parameters:
      columnName - name of column to interrogate
      instanceTableRow - row from the database
      isRequired - is this value required
      Returns:
      string value
      Throws:
      RepositoryErrorException - missing value
    • setUpStringValueInRow

      protected void setUpStringValueInRow(Map<String,JDBCDataValue> instanceTableRow, String propertyValue, String columnName, boolean isRequired) throws RepositoryErrorException
      Set up the string value in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValue - value to set up
      columnName - column to place the value in
      isRequired - is this value allowed to be null
      Throws:
      RepositoryErrorException - missing property value
    • setUpStringArrayValueInRow

      protected void setUpStringArrayValueInRow(Map<String,JDBCDataValue> instanceTableRow, List<String> propertyValues, String columnName, boolean isRequired) throws RepositoryErrorException
      Set up the list of string values as a comma-separated list in a single string column in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValues - value to set up
      columnName - column to place the value in
      isRequired - is this value allowed to be null
      Throws:
      RepositoryErrorException - missing property value
    • setUpSerializableMapValueInRow

      protected void setUpSerializableMapValueInRow(Map<String,JDBCDataValue> instanceTableRow, Map<String,Serializable> propertyValues, String columnName, boolean isRequired) throws RepositoryErrorException
      Set up the list of string values as a comma-separated list in a single string column in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValues - value to set up
      columnName - column to place the value in
      isRequired - is this value allowed to be null
      Throws:
      RepositoryErrorException - missing property value
    • setUpDateValueInRow

      protected void setUpDateValueInRow(Map<String,JDBCDataValue> instanceTableRow, Date propertyValue, String columnName, boolean isRequired) throws RepositoryErrorException
      Set up the string value in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValue - value to set up
      columnName - column to place the value in
      isRequired - is this value allowed to be null
      Throws:
      RepositoryErrorException - missing property value
    • setUpBooleanValueInRow

      protected void setUpBooleanValueInRow(Map<String,JDBCDataValue> instanceTableRow, boolean propertyValue, String columnName)
      Set up the string value in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValue - value to set up
      columnName - column to place the value in
    • setUpLongValueInRow

      protected void setUpLongValueInRow(Map<String,JDBCDataValue> instanceTableRow, long propertyValue, String columnName)
      Set up the string value in the supplied instance table row.
      Parameters:
      instanceTableRow - table row
      propertyValue - value to set up
      columnName - column to place the value in