diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/iciql/SQLDialectDefault.java | 6 | ||||
-rw-r--r-- | src/main/java/com/iciql/SQLDialectSQLite.java | 23 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/main/java/com/iciql/SQLDialectDefault.java b/src/main/java/com/iciql/SQLDialectDefault.java index d8a9ebd..7c656bd 100644 --- a/src/main/java/com/iciql/SQLDialectDefault.java +++ b/src/main/java/com/iciql/SQLDialectDefault.java @@ -337,12 +337,16 @@ public class SQLDialectDefault implements SQLDialect { protected boolean isIntegerType(String dataType) { if ("INT".equals(dataType)) { return true; - } else if ("BIGINT".equals(dataType)) { + } else if ("INTEGER".equals(dataType)) { return true; } else if ("TINYINT".equals(dataType)) { return true; } else if ("SMALLINT".equals(dataType)) { return true; + } else if ("MEDIUMINT".equals(dataType)) { + return true; + } else if ("BIGINT".equals(dataType)) { + return true; } return false; } diff --git a/src/main/java/com/iciql/SQLDialectSQLite.java b/src/main/java/com/iciql/SQLDialectSQLite.java index c9bf8ec..4234e9f 100644 --- a/src/main/java/com/iciql/SQLDialectSQLite.java +++ b/src/main/java/com/iciql/SQLDialectSQLite.java @@ -50,6 +50,29 @@ public class SQLDialectSQLite extends SQLDialectDefault { }
@Override
+ public String convertSqlType(String sqlType) {
+ if (isIntegerType(sqlType)) {
+ return "INTEGER";
+ }
+ return sqlType;
+ }
+
+ @Override
+ protected boolean prepareColumnDefinition(StatementBuilder buff, String dataType,
+ boolean isAutoIncrement, boolean isPrimaryKey) {
+ String convertedType = convertSqlType(dataType);
+ buff.append(convertedType);
+ if (isPrimaryKey) {
+ buff.append(" PRIMARY KEY");
+ if (isAutoIncrement) {
+ buff.append(" AUTOINCREMENT");
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
public <T> void prepareDropView(SQLStatement stat, TableDefinition<T> def) {
StatementBuilder buff = new StatementBuilder("DROP VIEW IF EXISTS "
+ prepareTableName(def.schemaName, def.tableName));
|