@Override public String handleAnySqlPostTranslation(String string, ChangeInput change) { if (change != null && change.getMetadataSection() != null && change.getMetadataSection().isTogglePresent(TextMarkupDocumentReader.TOGGLE_DISABLE_QUOTED_IDENTIFIERS)) { if (!change.getChangeKey().getChangeType().getName().equals(ChangeType.VIEW_STR)) { // only needed for HSQL seemingly for views only, seemingly not for H2 string = string.replace('"', '\''); } } Matcher varbinaryDefaultMatcher = this.varbinaryDefaultPattern.matcher(string); if (varbinaryDefaultMatcher.find()) { string = varbinaryDefaultMatcher.replaceFirst("varbinary(1)" + varbinaryDefaultMatcher.group(1)); } return string; }
@Override public String handleAnySqlPostTranslation(String string, ChangeInput change) { if (change != null && change.getMetadataSection() != null && change.getMetadataSection().isTogglePresent(TextMarkupDocumentReader.TOGGLE_DISABLE_QUOTED_IDENTIFIERS)) { if (!change.getChangeKey().getChangeType().getName().equals(ChangeType.VIEW_STR)) { // only needed for HSQL seemingly for views only, seemingly not for H2 string = string.replace('"', '\''); } } Matcher varbinaryDefaultMatcher = this.varbinaryDefaultPattern.matcher(string); if (varbinaryDefaultMatcher.find()) { string = varbinaryDefaultMatcher.replaceFirst("varbinary(1)" + varbinaryDefaultMatcher.group(1)); } return string; }
@Override public String handleAnySqlPostTranslation(String string, ChangeInput change) { if (change != null && change.getMetadataSection() != null && change.getMetadataSection().isTogglePresent(TextMarkupDocumentReader.TOGGLE_DISABLE_QUOTED_IDENTIFIERS)) { if (!change.getChangeKey().getChangeType().getName().equals(ChangeType.VIEW_STR)) { // only needed for HSQL seemingly for views only, seemingly not for H2 string = string.replace('"', '\''); } } Matcher varbinaryDefaultMatcher = this.varbinaryDefaultPattern.matcher(string); if (varbinaryDefaultMatcher.find()) { string = varbinaryDefaultMatcher.replaceFirst("varbinary(1)" + varbinaryDefaultMatcher.group(1)); } return string; }
@Override public String handleAnySqlPostTranslation(String string, ChangeInput change) { if (change != null && change.getMetadataSection() != null && change.getMetadataSection().isTogglePresent(TextMarkupDocumentReader.TOGGLE_DISABLE_QUOTED_IDENTIFIERS)) { if (!change.getChangeKey().getChangeType().getName().equals(ChangeType.VIEW_STR)) { // only needed for HSQL seemingly for views only, seemingly not for H2 string = string.replace('"', '\''); } } Matcher varbinaryDefaultMatcher = this.varbinaryDefaultPattern.matcher(string); if (varbinaryDefaultMatcher.find()) { string = varbinaryDefaultMatcher.replaceFirst("varbinary(1)" + varbinaryDefaultMatcher.group(1)); } return string; }
@Override public final String prepare(String sql, final ChangeInput change, final Environment env) { if (change != null && Objects.equals(change.getChangeKey().getChangeType().getName(), ChangeType.STATICDATA_STR) && !StaticDataChangeTypeBehavior.isInsertModeStaticData(sql)) { return sql; } sql = CommentRemover.removeComments(sql, change != null ? change.getChangeKey().toString() : sql); MutableList<String> sqls = MultiLineStringSplitter.createSplitterOnSpaceAndLine("GO").valueOf(sql); MutableList<String> convertedSqls = sqls.collect(new Function<String, String>() { @Override public String valueOf(String object) { return InMemoryTranslator.this.translateStatement(object, change); } }); return convertedSqls.makeString("\n\nGO\n\n"); }
@Override public final String prepare(String sql, final ChangeInput change, final Environment env) { if (change != null && Objects.equals(change.getChangeKey().getChangeType().getName(), ChangeType.STATICDATA_STR) && !StaticDataChangeTypeBehavior.isInsertModeStaticData(sql)) { return sql; } sql = CommentRemover.removeComments(sql, change != null ? change.getChangeKey().toString() : sql); MutableList<String> sqls = MultiLineStringSplitter.createSplitterOnSpaceAndLine("GO").valueOf(sql); MutableList<String> convertedSqls = sqls.collect(new Function<String, String>() { @Override public String valueOf(String object) { return InMemoryTranslator.this.translateStatement(object, change); } }); return convertedSqls.makeString("\n\nGO\n\n"); }