aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/iciql/ModelUtils.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2011-08-08 11:12:50 -0400
committerJames Moger <james.moger@gmail.com>2011-08-08 11:12:50 -0400
commit35973f16d6e408fff3e9eeeda4dac4ab3f7cb048 (patch)
treebd266925e65837ecbfe18ac3b734a05d6bf49bdc /src/com/iciql/ModelUtils.java
parentf7485f5f18e49cef057782c0c3137e64a5af542c (diff)
downloadiciql-35973f16d6e408fff3e9eeeda4dac4ab3f7cb048.tar.gz
iciql-35973f16d6e408fff3e9eeeda4dac4ab3f7cb048.zip
Documentation. EnumType default is NAME.
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)) {