Class EntityMapper
java.lang.Object
org.odpi.openmetadata.adapters.connectors.resource.jdbc.mappers.BaseMapper
org.odpi.openmetadata.adapters.repositoryservices.postgres.repositoryconnector.mappers.RepositoryMapper
org.odpi.openmetadata.adapters.repositoryservices.postgres.repositoryconnector.mappers.EntityMapper
Map between an EntityDetail or EntityProxy object and a collection of database rows.
This mapping can go in either direction.
-
Constructor Summary
ConstructorDescriptionEntityMapper
(Map<String, JDBCDataValue> entityTableRow, List<Map<String, JDBCDataValue>> entityPropertiesTableRows, List<ClassificationMapper> classificationMappers, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using the values from the database.EntityMapper
(EntityDetail entityDetail, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using an OMRS instance.EntityMapper
(EntityProxy entityProxy, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using an OMRS instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn the list of classification mappers that represent the classifications associated with this entity.Construct an entity detail object using the values from the database.Return the rows that describe the properties for this entity.Construct an entity proxy object from the values from the database.Extract the entity table information from the entity object.Return the rows that describe the properties for this entity.boolean
isProxy()
Determine whether this entity is a proxy or not.toString()
JSON-style toStringMethods inherited from class org.odpi.openmetadata.adapters.repositoryservices.postgres.repositoryconnector.mappers.RepositoryMapper
extractValuesFromInstanceAuditHeader, extractValuesFromInstanceHeader, fillInstanceAuditHeader, fillInstanceHeader, getInstanceProperties, getUniqueProperties
Methods inherited from class org.odpi.openmetadata.adapters.connectors.resource.jdbc.mappers.BaseMapper
getBooleanPropertyFromColumn, getDatePropertyFromColumn, getLongPropertyFromColumn, getSerializableMapPropertyFromColumn, getStringArrayPropertyFromColumn, getStringPropertyFromColumn, setUpBooleanValueInRow, setUpDateValueInRow, setUpLongValueInRow, setUpSerializableMapValueInRow, setUpStringArrayValueInRow, setUpStringValueInRow
-
Constructor Details
-
EntityMapper
public EntityMapper(EntityDetail entityDetail, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using an OMRS instance.- Parameters:
entityDetail
- full entityrepositoryHelper
- repository helperrepositoryName
- repository name
-
EntityMapper
public EntityMapper(EntityProxy entityProxy, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using an OMRS instance.- Parameters:
entityProxy
- entity proxyrepositoryHelper
- repository helperrepositoryName
- repository name
-
EntityMapper
public EntityMapper(Map<String, JDBCDataValue> entityTableRow, List<Map<String, JDBCDataValue>> entityPropertiesTableRows, List<ClassificationMapper> classificationMappers, OMRSRepositoryHelper repositoryHelper, String repositoryName) Construct an entity mapper using the values from the database.- Parameters:
entityTableRow
- row from the entity tableentityPropertiesTableRows
- rows from the entity properties tableclassificationMappers
- mappers representing the entity's classificationsrepositoryHelper
- repository helperrepositoryName
- repository name
-
-
Method Details
-
isProxy
Determine whether this entity is a proxy or not.- Returns:
- boolean
- Throws:
RepositoryErrorException
- mapping problem
-
getEntityDetail
Construct an entity detail object using the values from the database.- Returns:
- full entity description or null if the entity is not available
- Throws:
RepositoryErrorException
- problem mapping the properties
-
getEntityProxy
Construct an entity proxy object from the values from the database.- Returns:
- entity proxy description
- Throws:
RepositoryErrorException
- problem mapping the properties
-
getEntityTableRow
Extract the entity table information from the entity object.- Returns:
- entity table row for this entity
- Throws:
RepositoryErrorException
- problem mapping the properties
-
getEntityPropertiesTableRows
public List<Map<String,JDBCDataValue>> getEntityPropertiesTableRows() throws RepositoryErrorExceptionReturn the rows that describe the properties for this entity.- Returns:
- property rows
- Throws:
RepositoryErrorException
- problem mapping the properties
-
getUniquePropertiesTableRows
public List<Map<String,JDBCDataValue>> getUniquePropertiesTableRows() throws RepositoryErrorExceptionReturn the rows that describe the properties for this entity. This version allows an entity proxy's properties to be stored if the entity detail is not available.- Returns:
- property rows
- Throws:
RepositoryErrorException
- problem mapping the properties
-
getClassificationMappers
Return the list of classification mappers that represent the classifications associated with this entity.- Returns:
- list of classification mappers or null
-
toString
JSON-style toString
-