Source:
private String buildCreateGlobalViewStmt(String fullGlobalViewName, String fullTableName, String globalViewCondition) { StringBuilder statement = new StringBuilder(); StringBuilder viewDefinition = new StringBuilder(); if (!globalViewOptions.globalViewPKColumns.isEmpty() || !globalViewOptions.globalViewColumns.isEmpty()) { viewDefinition.append(("(")); if (!globalViewOptions.globalViewPKColumns.isEmpty()) { viewDefinition.append(getColumnsAsString(globalViewOptions.globalViewPKColumns, globalViewOptions.globalViewPKColumnTypes, true)); } if (!globalViewOptions.globalViewColumns.isEmpty()) { viewDefinition .append(globalViewOptions.globalViewPKColumns.isEmpty() ? "" : ",") .append(getFQColumnsAsString(globalViewOptions.globalViewColumns, otherOptions.globalViewCFs, globalViewOptions.globalViewColumnTypes)); } if (!globalViewOptions.globalViewPKColumns.isEmpty()) { viewDefinition.append(" CONSTRAINT pk PRIMARY KEY ").append("(") .append(getPKColumnsWithSort(globalViewOptions.globalViewPKColumns, globalViewOptions.globalViewPKColumnSort)).append(")"); } viewDefinition.append((")")); } statement.append("CREATE VIEW IF NOT EXISTS ").append(fullGlobalViewName) .append(viewDefinition.toString()).append(" AS SELECT * FROM ") .append(fullTableName).append(" WHERE ").append(globalViewCondition).append(" ") .append((globalViewOptions.tableProps.isEmpty() ? "" : globalViewOptions.tableProps)); if (globalViewOptions.isChangeDetectionEnabled()) { if (!globalViewOptions.tableProps.isEmpty()) { statement.append(", "); } statement.append("CHANGE_DETECTION_ENABLED=true"); } LOGGER.info(statement.toString()); return statement.toString(); }

Target:
private String buildCreateGlobalViewStmt(String fullGlobalViewName, String fullTableName, String globalViewCondition) { StringBuilder statement = new StringBuilder(); StringBuilder viewDefinition = new StringBuilder(); if (!globalViewOptions.globalViewPKColumns.isEmpty() || !globalViewOptions.globalViewColumns.isEmpty()) { viewDefinition.append(("(")); if (!globalViewOptions.globalViewPKColumns.isEmpty()) { viewDefinition.append(getColumnsAsString(globalViewOptions.globalViewPKColumns, globalViewOptions.globalViewPKColumnTypes, true)); } if (!globalViewOptions.globalViewColumns.isEmpty()) { viewDefinition .append(globalViewOptions.globalViewPKColumns.isEmpty() ? "" : ",") .append(getFQColumnsAsString(globalViewOptions.globalViewColumns, otherOptions.globalViewCFs, globalViewOptions.globalViewColumnTypes)); } if (!globalViewOptions.globalViewPKColumns.isEmpty()) { viewDefinition.append(" CONSTRAINT pk PRIMARY KEY ").append("(") .append(getPKColumnsWithSort(globalViewOptions.globalViewPKColumns, globalViewOptions.globalViewPKColumnSort)).append(")"); } viewDefinition.append((")")); } statement.append("CREATE VIEW IF NOT EXISTS ").append(fullGlobalViewName) .append(viewDefinition.toString()).append(" AS SELECT * FROM ") .append(fullTableName).append(" WHERE ").append(globalViewCondition).append(" ") .append((globalViewOptions.tableProps.isEmpty() ? "" : globalViewOptions.tableProps)); if (globalViewOptions.isChangeDetectionEnabled()) { if (!globalViewOptions.tableProps.isEmpty()) { statement.append(", "); } statement.append(CHANGE_DETECTION_ENABLED + "=true"); } LOGGER.info(statement.toString()); return statement.toString(); }