diff options
author | James Moger <james.moger@gmail.com> | 2011-08-08 11:12:50 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-08-08 11:12:50 -0400 |
commit | 35973f16d6e408fff3e9eeeda4dac4ab3f7cb048 (patch) | |
tree | bd266925e65837ecbfe18ac3b734a05d6bf49bdc /src/com/iciql/ModelUtils.java | |
parent | f7485f5f18e49cef057782c0c3137e64a5af542c (diff) | |
download | iciql-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.java | 13 |
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)) { |