diff options
author | James Moger <james.moger@gmail.com> | 2011-08-10 09:01:04 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-08-10 09:01:04 -0400 |
commit | 1d381026a5d256a59fe41da42c7f4e86bb60f02c (patch) | |
tree | fd6e7a8aa8d8d2b9855d1e8e249798d372f84f3a /src/com/iciql/SQLDialect.java | |
parent | 01ec38ed904bd24c9075edfc12c2b41c1e13d249 (diff) | |
download | iciql-1d381026a5d256a59fe41da42c7f4e86bb60f02c.tar.gz iciql-1d381026a5d256a59fe41da42c7f4e86bb60f02c.zip |
Dialect refinements.
Diffstat (limited to 'src/com/iciql/SQLDialect.java')
-rw-r--r-- | src/com/iciql/SQLDialect.java | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/com/iciql/SQLDialect.java b/src/com/iciql/SQLDialect.java index 8291e53..3ca2c4c 100644 --- a/src/com/iciql/SQLDialect.java +++ b/src/com/iciql/SQLDialect.java @@ -17,7 +17,7 @@ package com.iciql; -import java.sql.Connection; +import java.sql.DatabaseMetaData; import com.iciql.TableDefinition.IndexDefinition; @@ -28,22 +28,23 @@ import com.iciql.TableDefinition.IndexDefinition; public interface SQLDialect { /** - * Configure the dialect from the database connection. + * Configure the dialect from the database metadata. * - * @param conn + * @param databaseName + * @param data */ - void configureDialect(Connection conn); + void configureDialect(String databaseName, DatabaseMetaData data); /** * Returns a properly formatted table name for the dialect. * - * @param schema + * @param schemaName * the schema name, or null for no schema - * @param table + * @param tableName * the properly formatted table name * @return the SQL snippet */ - String prepareTableName(String schema, String table); + String prepareTableName(String schemaName, String tableName); /** * Returns a properly formatted column name for the dialect. @@ -57,15 +58,27 @@ public interface SQLDialect { /** * Get the CREATE INDEX statement. * - * @param schema + * @param schemaName * the schema name - * @param table + * @param tableName * the table name * @param index * the index definition * @return the SQL statement */ - String prepareCreateIndex(String schema, String table, IndexDefinition index); + String prepareCreateIndex(String schemaName, String tableName, IndexDefinition index); + + /** + * Get a MERGE or REPLACE INTO statement. + * + * @param schemaName + * the schema name + * @param tableName + * the table name + * @param index + * the index definition + */ + <T> void prepareMerge(SQLStatement stat, String schemaName, String tableName, TableDefinition<T> def, Object obj); /** * Append "LIMIT limit" to the SQL statement. |