Source:
<code>public void removeAssignment(String providerId, String dataSetId, String recordId, String schema, String versionId) throws DataSetNotExistsException { isDataSetExists(providerId, dataSetId); dataSetDAO.removeAssignment(providerId, dataSetId, recordId, schema, versionId); DataProvider dataProvider = uis.getProvider(providerId); if (!dataSetDAO.hasMoreRepresentations(providerId, dataSetId, schema)) { dataSetDAO.removeRepresentationNameForDataSet(schema, providerId, dataSetId); } Representation representation = recordDAO.getRepresentation(recordId, schema, versionId); representationIndexer.removeAssignment(recordId, schema, new CompoundDataSetId(providerId, dataSetId), dataProvider.getPartitionKey()); Set<String> deletedRevisions = new HashSet<>(); if (representation != null) { for (Revision revision : representation.getRevisions()) { String revisionName = revision.getRevisionName(); String revisionProvider = revision.getRevisionProviderId(); <START> String revisionId = revisionName + "_" + revisionProvider; <END> if (!deletedRevisions.contains(revisionId)) { dataSetDAO.deleteLatestProviderDatasetRepresentationInfo(dataSetId, providerId, recordId, schema, revisionName, revisionProvider); deletedRevisions.add(revisionId); } dataSetDAO.removeDataSetsRevision(providerId, dataSetId, RevisionUtils.getRevisionKey(revision), schema, recordId); dataSetDAO.deleteProviderDatasetRepresentationInfo(dataSetId, providerId, recordId, schema, revision.getUpdateTimeStamp()); } } if (!deletedRevisions.isEmpty()) { } }</code><technical_language>revision id is created RevisionUtils class</technical_language>

Target:
public void removeAssignment(String providerId, String dataSetId, String recordId, String schema, String versionId) throws DataSetNotExistsException { isDataSetExists(providerId, dataSetId); dataSetDAO.removeAssignment(providerId, dataSetId, recordId, schema, versionId); DataProvider dataProvider = uis.getProvider(providerId); if (!dataSetDAO.hasMoreRepresentations(providerId, dataSetId, schema)) { dataSetDAO.removeRepresentationNameForDataSet(schema, providerId, dataSetId); } Representation representation = recordDAO.getRepresentation(recordId, schema, versionId); representationIndexer.removeAssignment(recordId, schema, new CompoundDataSetId(providerId, dataSetId), dataProvider.getPartitionKey()); Set<String> deletedRevisions = new HashSet<>(); if (representation != null) { for (Revision revision : representation.getRevisions()) { String revisionName = revision.getRevisionName(); String revisionProvider = revision.getRevisionProviderId(); String revisionId = revisionName + "_" + revisionProvider; if (!deletedRevisions.contains(revisionId)) { dataSetDAO.deleteLatestProviderDatasetRepresentationInfo(dataSetId, providerId, recordId, schema, revisionName, revisionProvider); deletedRevisions.add(revisionId); } dataSetDAO.removeDataSetsRevision(providerId, dataSetId, RevisionUtils.getRevisionKey(revision), schema, recordId); dataSetDAO.deleteProviderDatasetRepresentationInfo(dataSetId, providerId, recordId, schema, revision.getUpdateTimeStamp()); DataSet ds = dataSetDAO.getDataSet(providerId, dataSetId); dataSetDAO.removeLatestRevisionForDatasetAssignment(ds, representation, revision); } } if (!deletedRevisions.isEmpty()) { } }