worksheet.getSemanticTypes().addSynonymTypesForHNodeId(hNodeId, newSynonymTypes);
@Override public UpdateContainer undoIt(Workspace workspace) { UpdateContainer c = new UpdateContainer(); Worksheet worksheet = workspace.getWorksheet(worksheetId); if (oldType == null) { worksheet.getSemanticTypes().unassignColumnSemanticType(hNodeId); } else { worksheet.getSemanticTypes().setType(oldType); worksheet.getSemanticTypes().addSynonymTypesForHNodeId(hNodeId, oldSynonymTypes); } // Replace the current alignment with the old alignment String alignmentId = AlignmentManager.Instance().constructAlignmentId(workspace.getId(), worksheetId); AlignmentManager.Instance().addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); // Get the alignment update if any try { c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace)); } catch (Exception e) { logger.error("Error occured while unsetting the semantic type!", e); return new UpdateContainer(new ErrorUpdate( "Error occured while unsetting the semantic type!")); } return c; }
@Override public UpdateContainer undoIt(Workspace workspace) { UpdateContainer c = new UpdateContainer(); Worksheet worksheet = workspace.getWorksheet(worksheetId); if (oldType == null) { worksheet.getSemanticTypes().unassignColumnSemanticType(hNodeId); } else { worksheet.getSemanticTypes().setType(oldType); worksheet.getSemanticTypes().addSynonymTypesForHNodeId( hNodeId, oldSynonymTypes); } // Replace the current alignment with the old alignment String alignmentId = AlignmentManager.Instance().constructAlignmentId( workspace.getId(), worksheetId); AlignmentManager.Instance() .addAlignmentToMap(alignmentId, oldAlignment); oldAlignment.setGraph(oldGraph); // Get the alignment update if any try { c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace)); } catch (Exception e) { logger.error("Error occured while unsetting the semantic type!", e); return new UpdateContainer(new ErrorUpdate( "Error occured while unsetting the semantic type!")); } return c; }