Accept null uConCols and pKeyCols as advertised.
This commit is contained in:
@@ -208,16 +208,11 @@ public abstract class BaseLiaison implements DatabaseLiaison
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// from DatabaseLiaison
|
||||||
* Created a new table of the given name with the given column names and column definitions;
|
|
||||||
* the given set of unique constraints (or null) and the given primary key columns (or null).
|
|
||||||
* Returns true if the table was successfully created, false if it already existed.
|
|
||||||
*/
|
|
||||||
public boolean createTableIfMissing (Connection conn, String table, List<String> columns,
|
public boolean createTableIfMissing (Connection conn, String table, List<String> columns,
|
||||||
List<ColumnDefinition> declarations,
|
List<ColumnDefinition> declarations,
|
||||||
List<String> primaryKeyColumns) throws SQLException {
|
List<String> primaryKeyColumns) throws SQLException {
|
||||||
return createTableIfMissing(conn, table, columns, declarations,
|
return createTableIfMissing(conn, table, columns, declarations, null, primaryKeyColumns);
|
||||||
Collections.<List<String>>emptyList(), primaryKeyColumns);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// from DatabaseLiaison
|
// from DatabaseLiaison
|
||||||
@@ -244,13 +239,15 @@ public abstract class BaseLiaison implements DatabaseLiaison
|
|||||||
builder.append(expandDefinition(definitions.get(ii)));
|
builder.append(expandDefinition(definitions.get(ii)));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (List<String> uCols : uniqueConstraintColumns) {
|
if (uniqueConstraintColumns != null) {
|
||||||
builder.append(", UNIQUE (");
|
for (List<String> uCols : uniqueConstraintColumns) {
|
||||||
appendColumns(uCols, builder);
|
builder.append(", UNIQUE (");
|
||||||
builder.append(")");
|
appendColumns(uCols, builder);
|
||||||
|
builder.append(")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!primaryKeyColumns.isEmpty()) {
|
if (primaryKeyColumns != null && !primaryKeyColumns.isEmpty()) {
|
||||||
builder.append(", PRIMARY KEY (");
|
builder.append(", PRIMARY KEY (");
|
||||||
appendColumns(primaryKeyColumns, builder);
|
appendColumns(primaryKeyColumns, builder);
|
||||||
builder.append(")");
|
builder.append(")");
|
||||||
|
|||||||
Reference in New Issue
Block a user