@Test public void shouldReturnSimpleSqlInsertLoggingPropertyQuery() throws Exception { DBNameResolver nameResolver = createSimpleDBNameResolver(); String sql = SQLBuilder.buildInsertPropertiesSQL(nameResolver); final String expected = "INSERT INTO tp_logging_event_property_ts (cp_event_id_cs, cp_mapped_key_cs, cp_mapped_value_cs) VALUES (?, ?, ?)"; assertThat(sql).isEqualTo(expected); }
static String buildInsertPropertiesSQL(DBNameResolver dbNameResolver) { StringBuilder sqlBuilder = new StringBuilder("INSERT INTO "); sqlBuilder.append(dbNameResolver.getTableName(TableName.LOGGING_EVENT_PROPERTY)).append(" ("); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.EVENT_ID)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_KEY)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_VALUE)).append(") "); sqlBuilder.append("VALUES (?, ?, ?)"); return sqlBuilder.toString(); }
SQLBuilder { static String buildInsertPropertiesSQL(DBNameResolver dbNameResolver) { StringBuilder sqlBuilder = new StringBuilder("INSERT INTO "); sqlBuilder.append(dbNameResolver.getTableName(TableName.LOGGING_EVENT_PROPERTY)).append(" ("); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.EVENT_ID)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_KEY)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_VALUE)).append(") "); sqlBuilder.append("VALUES (?, ?, ?)"); return sqlBuilder.toString(); } }
SQLBuilder { static String buildInsertPropertiesSQL(DBNameResolver dbNameResolver) { StringBuilder sqlBuilder = new StringBuilder("INSERT INTO "); sqlBuilder.append(dbNameResolver.getTableName(TableName.LOGGING_EVENT_PROPERTY)).append(" ("); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.EVENT_ID)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_KEY)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_VALUE)).append(") "); sqlBuilder.append("VALUES (?, ?, ?)"); return sqlBuilder.toString(); }  }
SQLBuilder { static String buildInsertPropertiesSQL(DBNameResolver dbNameResolver) { StringBuilder sqlBuilder = new StringBuilder("INSERT INTO "); sqlBuilder.append(dbNameResolver.getTableName(TableName.LOGGING_EVENT_PROPERTY)).append(" ("); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.EVENT_ID)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_KEY)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_VALUE)).append(") "); sqlBuilder.append("VALUES (?, ?, ?)"); return sqlBuilder.toString(); }   }
SQLBuilder { static String buildInsertPropertiesSQL(DBNameResolver dbNameResolver) { StringBuilder sqlBuilder = new StringBuilder("INSERT INTO "); sqlBuilder.append(dbNameResolver.getTableName(TableName.LOGGING_EVENT_PROPERTY)).append(" ("); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.EVENT_ID)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_KEY)).append(", "); sqlBuilder.append(dbNameResolver.getColumnName(ColumnName.MAPPED_VALUE)).append(") "); sqlBuilder.append("VALUES (?, ?, ?)"); return sqlBuilder.toString(); }    }