Class BaseMapper
java.lang.Object
org.odpi.openmetadata.adapters.connectors.resource.jdbc.mappers.BaseMapper
- Direct Known Subclasses:
ControlMapper,RepositoryMapper
Common routines used by the mappers
-
Constructor Summary
ConstructorsConstructorDescriptionBaseMapper(String connectorName) Constructor ensures there is a connector name for error messages. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBooleanPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a date value from a specific column.getDatePropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a date value from a specific column.longgetLongPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a long value from a specific column.getSerializableMapPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a string value from a specific column.getStringArrayPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a string value from a specific column.getStringPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) Retrieve a string value from a specific column.protected voidsetUpBooleanValueInRow(Map<String, JDBCDataValue> instanceTableRow, boolean propertyValue, String columnName) Set up the string value in the supplied instance table row.protected voidsetUpDateValueInRow(Map<String, JDBCDataValue> instanceTableRow, Date propertyValue, String columnName, boolean isRequired) Set up the string value in the supplied instance table row.protected voidsetUpLongValueInRow(Map<String, JDBCDataValue> instanceTableRow, long propertyValue, String columnName) Set up the string value in the supplied instance table row.protected voidsetUpSerializableMapValueInRow(Map<String, JDBCDataValue> instanceTableRow, Map<String, Serializable> propertyValues, String columnName, boolean isRequired) Set up the list of string values as a comma-separated list in a single string column in the supplied instance table row.protected voidsetUpStringArrayValueInRow(Map<String, JDBCDataValue> instanceTableRow, List<String> propertyValues, String columnName, boolean isRequired) Set up the list of string values as a comma-separated list in a single string column in the supplied instance table row.protected voidsetUpStringValueInRow(Map<String, JDBCDataValue> instanceTableRow, String propertyValue, String columnName, boolean isRequired) Set up the string value in the supplied instance table row.
-
Constructor Details
-
BaseMapper
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 RepositoryErrorExceptionRetrieve a string value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- 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 RepositoryErrorExceptionRetrieve a string value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- 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 RepositoryErrorExceptionRetrieve a string value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- is this value required- Returns:
- string value
- Throws:
RepositoryErrorException- missing value
-
getDatePropertyFromColumn
public Date getDatePropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorExceptionRetrieve a date value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- is this value required- Returns:
- string value
- Throws:
RepositoryErrorException- missing value
-
getLongPropertyFromColumn
public long getLongPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorExceptionRetrieve a long value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- is this value required- Returns:
- string value
- Throws:
RepositoryErrorException- missing value
-
getBooleanPropertyFromColumn
public boolean getBooleanPropertyFromColumn(String columnName, Map<String, JDBCDataValue> instanceTableRow, boolean isRequired) throws RepositoryErrorExceptionRetrieve a date value from a specific column.- Parameters:
columnName- name of column to interrogateinstanceTableRow- row from the databaseisRequired- 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 RepositoryErrorExceptionSet up the string value in the supplied instance table row.- Parameters:
instanceTableRow- table rowpropertyValue- value to set upcolumnName- column to place the value inisRequired- 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 RepositoryErrorExceptionSet 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 rowpropertyValues- value to set upcolumnName- column to place the value inisRequired- is this value allowed to be null- Throws:
RepositoryErrorException- missing property value
-
setUpSerializableMapValueInRow
protected void setUpSerializableMapValueInRow(Map<String, JDBCDataValue> instanceTableRow, Map<String, throws RepositoryErrorExceptionSerializable> propertyValues, String columnName, boolean isRequired) 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 rowpropertyValues- value to set upcolumnName- column to place the value inisRequired- 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 RepositoryErrorExceptionSet up the string value in the supplied instance table row.- Parameters:
instanceTableRow- table rowpropertyValue- value to set upcolumnName- column to place the value inisRequired- 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 rowpropertyValue- value to set upcolumnName- 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 rowpropertyValue- value to set upcolumnName- column to place the value in
-