aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/iciql/Define.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/iciql/Define.java')
-rw-r--r--src/main/java/com/iciql/Define.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/main/java/com/iciql/Define.java b/src/main/java/com/iciql/Define.java
index 1810a4b..b16ee6e 100644
--- a/src/main/java/com/iciql/Define.java
+++ b/src/main/java/com/iciql/Define.java
@@ -18,6 +18,7 @@
package com.iciql;
+import com.iciql.Iciql.DataTypeAdapter;
import com.iciql.Iciql.IndexType;
/**
@@ -49,7 +50,7 @@ public class Define {
checkInDefine();
currentTableDefinition.defineConstraintUnique(name, columns);
}
-
+
/*
* The variable argument type Object can't be used twice :-)
*/
@@ -59,12 +60,12 @@ public class Define {
// checkInDefine();
// currentTableDefinition.defineForeignKey(name, columns, refTableName, Columns, deleteType, updateType, deferrabilityType);
// }
-
+
public static void primaryKey(Object... columns) {
checkInDefine();
currentTableDefinition.definePrimaryKey(columns);
}
-
+
public static void schemaName(String schemaName) {
checkInDefine();
currentTableDefinition.defineSchemaName(schemaName);
@@ -79,7 +80,7 @@ public class Define {
checkInDefine();
currentTableDefinition.defineViewTableName(viewTableName);
}
-
+
public static void memoryTable() {
checkInDefine();
currentTableDefinition.defineMemoryTable();
@@ -104,17 +105,17 @@ public class Define {
checkInDefine();
currentTableDefinition.defineScale(column, scale);
}
-
+
public static void trim(Object column) {
checkInDefine();
currentTableDefinition.defineTrim(column);
}
-
+
public static void nullable(Object column, boolean isNullable) {
checkInDefine();
currentTableDefinition.defineNullable(column, isNullable);
}
-
+
public static void defaultValue(Object column, String defaultValue) {
checkInDefine();
currentTableDefinition.defineDefaultValue(column, defaultValue);
@@ -125,6 +126,11 @@ public class Define {
currentTableDefinition.defineConstraint(column, constraint);
}
+ public static void typeAdapter(Object column, Class<? extends DataTypeAdapter<?>> typeAdapter) {
+ checkInDefine();
+ currentTableDefinition.defineTypeAdapter(column, typeAdapter);
+ }
+
static synchronized <T> void define(TableDefinition<T> tableDefinition, Iciql table) {
currentTableDefinition = tableDefinition;
currentTable = table;