/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for delete-all queries. */ @Override public void writeDeleteFromTargetTableUsingTempTableSql(Writer writer, DatabaseTable table, DatabaseTable targetTable, Collection pkFields, Collection targetPkFields, DatasourcePlatform platform) throws IOException { writer.write("DELETE FROM "); String targetTableName = targetTable.getQualifiedNameDelimited(this); writer.write(targetTableName); writer.write(" USING "); writer.write(targetTableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeJoinWhereClause(writer, targetTableName, tempTableName, targetPkFields, pkFields, this); }
/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for delete-all queries. */ public void writeDeleteFromTargetTableUsingTempTableSql(Writer writer, DatabaseTable table, DatabaseTable targetTable, Collection pkFields, Collection targetPkFields) throws IOException { writer.write("DELETE FROM "); String targetTableName = targetTable.getQualifiedNameDelimited(this); writer.write(targetTableName); writer.write(" USING "); writer.write(targetTableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeJoinWhereClause(writer, targetTableName, tempTableName, targetPkFields, pkFields, this); }
/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for delete-all queries. */ @Override public void writeDeleteFromTargetTableUsingTempTableSql(Writer writer, DatabaseTable table, DatabaseTable targetTable, Collection pkFields, Collection targetPkFields, DatasourcePlatform platform) throws IOException { writer.write("DELETE FROM "); String targetTableName = targetTable.getQualifiedNameDelimited(this); writer.write(targetTableName); writer.write(" USING "); writer.write(targetTableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeJoinWhereClause(writer, targetTableName, tempTableName, targetPkFields, pkFields, this); }
/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for update-all queries. */ public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException { writer.write("UPDATE "); String tableName = table.getQualifiedNameDelimited(this); writer.write(tableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeAutoAssignmentSetClause(writer, tableName, tempTableName, assignedFields, this); writeAutoJoinWhereClause(writer, tableName, tempTableName, pkFields, this); }
/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for update-all queries. */ @Override public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException { writer.write("UPDATE "); String tableName = table.getQualifiedNameDelimited(this); writer.write(tableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeAutoAssignmentSetClause(writer, tableName, tempTableName, assignedFields, this); writeAutoJoinWhereClause(writer, tableName, tempTableName, pkFields, this); }
/** * INTERNAL: * Writes MySQL specific SQL for accessing temp tables for update-all queries. */ @Override public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException { writer.write("UPDATE "); String tableName = table.getQualifiedNameDelimited(this); writer.write(tableName); writer.write(", "); String tempTableName = getTempTableForTable(table).getQualifiedNameDelimited(this); writer.write(tempTableName); writeAutoAssignmentSetClause(writer, tableName, tempTableName, assignedFields, this); writeAutoJoinWhereClause(writer, tableName, tempTableName, pkFields, this); }