Class EraseResourceDAO
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
-
- com.ibm.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
-
- com.ibm.fhir.persistence.jdbc.dao.EraseResourceDAO
-
- All Implemented Interfaces:
FHIRDbDAO,ResourceDAO
public class EraseResourceDAO extends ResourceDAOImpl
EraseDAO is the data access layer of the erase operation which executes directly against the database using SQL statements to:- check the resource exists
- delete all versions from the resource table
- delete all parameters
- delete entries from global table
- delete resource specific logical resource entry
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
DEFAULT_VALUE_REINDEX_TSTAMP, IDX_DATA, IDX_IS_DELETED, IDX_LAST_UPDATED, IDX_LOGICAL_ID, IDX_LOGICAL_RESOURCE_ID, IDX_RESOURCE_ID, IDX_RESOURCE_PAYLOAD_KEY, IDX_RESOURCE_TYPE_ID, IDX_VERSION_ID
-
-
Constructor Summary
Constructors Constructor Description EraseResourceDAO(java.sql.Connection conn, java.lang.String adminSchemaName, IDatabaseTranslator translator, java.lang.String schemaName, FHIRDbFlavor flavor, FHIRPersistenceJDBCCache cache, IResourceReferenceDAO rrd)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearErasedResourcesInGroup(long erasedResourceGroupId)Delete all the ERASED_RESOURCE records belonging to the given erasedResourceGroupIdvoiddeleteFromAllParametersTables(java.lang.String tablePrefix, long logicalResourceId)Deletes from the Parameterslongerase(ResourceEraseRecord eraseRecord, EraseDTO eraseDto)processes the erasejava.util.List<ErasedResourceRec>getErasedResourceRecords(long erasedResourceGroupId)Fetch all the ERASED_RESOURCE records associated with the given erasedResourceGroupIdvoidrunInDao(long erasedResourceGroupId)Executes the SQL logic as part of the dao rather than via a stored procedure/function.-
Methods inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
checkIfNoneMatch, createDTO, deleteFromParameterTable, getCache, getResourceReferenceDAO, getResourceTypeId, getSearchByIdsNoDataSql, getSearchByIdsSql, getTransactionData, history, historyCount, insert, read, readAllResourceTypeNames, readResourceTypeId, search, search, searchByIds, searchCount, searchCount, searchForIds, searchWholeSystem, setInt, setPersistenceContext, setString, versionRead
-
Methods inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
buildExceptionWithIssue, buildFHIRPersistenceDBConnectException, cleanup, cleanup, createDTOs, getConnection, getFlavor, getSchemaName, getTranslator, isDb2Database, runCountQuery, runCountQuery, runQuery, runQuery, runQuery_STR_VALUES, severe, severe
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.fhir.persistence.jdbc.dao.api.FHIRDbDAO
getConnection, getFlavor, isDb2Database
-
-
-
-
Constructor Detail
-
EraseResourceDAO
public EraseResourceDAO(java.sql.Connection conn, java.lang.String adminSchemaName, IDatabaseTranslator translator, java.lang.String schemaName, FHIRDbFlavor flavor, FHIRPersistenceJDBCCache cache, IResourceReferenceDAO rrd)Public constructor- Parameters:
conn-adminSchemaName-translator-schemaName-flavor-cache-rrd-
-
-
Method Detail
-
runInDao
public void runInDao(long erasedResourceGroupId) throws FHIRPersistenceExceptionExecutes the SQL logic as part of the dao rather than via a stored procedure/function.- Parameters:
erasedResourceGroupId-- Throws:
java.sql.SQLExceptionFHIRPersistenceException
-
deleteFromAllParametersTables
public void deleteFromAllParametersTables(java.lang.String tablePrefix, long logicalResourceId) throws java.sql.SQLExceptionDeletes from the Parameters- Parameters:
tablePrefix-logicalResourceId-- Throws:
java.sql.SQLException
-
erase
public long erase(ResourceEraseRecord eraseRecord, EraseDTO eraseDto) throws java.lang.Exception
processes the erase- Parameters:
eraseRecord- the outputeraseDto- the input- Throws:
java.lang.Exception
-
getErasedResourceRecords
public java.util.List<ErasedResourceRec> getErasedResourceRecords(long erasedResourceGroupId)
Fetch all the ERASED_RESOURCE records associated with the given erasedResourceGroupId- Parameters:
erasedResourceGroupId-- Returns:
-
clearErasedResourcesInGroup
public void clearErasedResourcesInGroup(long erasedResourceGroupId)
Delete all the ERASED_RESOURCE records belonging to the given erasedResourceGroupId- Parameters:
erasedResourceGroupId-
-
-