[#6307] SQL Server support

This commit is contained in:
lukaseder 2017-06-05 13:58:24 +02:00
parent 186ef46795
commit 43ff705bbd
2 changed files with 10 additions and 1 deletions

View File

@ -34,6 +34,9 @@
*/
package org.jooq.util;
import static java.util.Arrays.asList;
// ...
import java.util.ArrayList;
import java.util.List;
@ -111,6 +114,11 @@ public class DefaultGeneratorStrategy extends AbstractGeneratorStrategy {
if (identifier != null)
return identifier;
// [#6307] Some databases work with per-table namespacing for indexes, not per-schema namespacing.
// In order to have non-ambiguous identifiers, we need to include the table name.
else if (definition instanceof IndexDefinition && asList().contains(definition.getDatabase().getDialect().family()))
return ((IndexDefinition) definition).getTable().getOutputName().toUpperCase() + "_" + definition.getOutputName().toUpperCase();
else
return definition.getOutputName().toUpperCase();
}

View File

@ -1507,7 +1507,8 @@ public abstract class AbstractDatabase implements Database {
try {
List<IndexDefinition> r = getIndexes0();
indexes = sort(filterExcludeInclude(r));
indexes = sort(r);
// indexes = sort(filterExcludeInclude(r)); TODO Support include / exclude for indexes (and constraints!)
log.info("Indexes fetched", fetchedSize(r, indexes));
}
catch (Exception e) {