aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/iciql/ModelUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/iciql/ModelUtils.java')
-rw-r--r--src/com/iciql/ModelUtils.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/com/iciql/ModelUtils.java b/src/com/iciql/ModelUtils.java
index 51c2d6c..4607e30 100644
--- a/src/com/iciql/ModelUtils.java
+++ b/src/com/iciql/ModelUtils.java
@@ -28,6 +28,7 @@ import java.util.Map;
import java.util.UUID;
import java.util.regex.Pattern;
+import com.iciql.Iciql.EnumType;
import com.iciql.TableDefinition.FieldDefinition;
import com.iciql.util.StringUtils;
@@ -150,18 +151,16 @@ class ModelUtils {
static String getDataType(FieldDefinition fieldDef, boolean strictTypeMapping) {
Class<?> fieldClass = fieldDef.field.getType();
if (fieldClass.isEnum()) {
- if (fieldDef.enumType == null) {
- throw new IciqlException(fieldDef.field.getName() + " enum field does not specify @IQEnum!");
- }
switch (fieldDef.enumType) {
- case STRING:
+ case ORDINAL:
+ case ENUMID:
+ return "INT";
+ case NAME:
+ default:
if (fieldDef.maxLength <= 0) {
return "TEXT";
}
return "VARCHAR";
- case ORDINAL:
- case ENUMID:
- return "INT";
}
}
if (SUPPORTED_TYPES.containsKey(fieldClass)) {