diff --git a/src/main/java/com/samskivert/jdbc/BaseLiaison.java b/src/main/java/com/samskivert/jdbc/BaseLiaison.java index ea01fe73..81cfb630 100644 --- a/src/main/java/com/samskivert/jdbc/BaseLiaison.java +++ b/src/main/java/com/samskivert/jdbc/BaseLiaison.java @@ -9,6 +9,7 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.util.Collections; import java.util.List; import com.samskivert.util.StringUtil; @@ -185,8 +186,20 @@ public abstract class BaseLiaison implements DatabaseLiaison return true; } + /** + * 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 columns, + List declarations, + List primaryKeyColumns) throws SQLException { + return createTableIfMissing(conn, table, columns, declarations, + Collections.>emptyList(), primaryKeyColumns); + } + @Override // from DatabaseLiaison - public boolean createTableIfMissing (Connection conn, String table, List columns, + public boolean createTableIfMissing (Connection conn, String table, List columns, List definitions, List> uniqueConstraintColumns, List primaryKeyColumns) diff --git a/src/main/java/com/samskivert/jdbc/DatabaseLiaison.java b/src/main/java/com/samskivert/jdbc/DatabaseLiaison.java index ed271ea1..8ef1751a 100644 --- a/src/main/java/com/samskivert/jdbc/DatabaseLiaison.java +++ b/src/main/java/com/samskivert/jdbc/DatabaseLiaison.java @@ -137,6 +137,16 @@ public interface DatabaseLiaison ColumnDefinition columnDef) throws SQLException; + /** + * 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 columns, + List declarations, + List primaryKeyColumns) + throws SQLException; + /** * 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).