#443 - ENH: Enum mapping - Add annotation @DbEnumValue that can be used to on a enum method which provides DB values

This commit is contained in:
Robin Bygrave committed 2015-10-30 21:42:21 +13:00
1 parent fc0b47342b
commit b326724139
10 files changed
+247 -20

No files matched your search

@@ -111,8 +111,8 @@ public class DeployUtil {
}
ScalarType<?> scalarType = typeManager.getScalarType(enumType);
if (scalarType == null) {
// see if it has a Mapping in avaje.properties
scalarType = typeManager.createEnumScalarType(enumType);
// look for @DbEnumValue or @EnumValue annotations etc
scalarType = typeManager.createEnumScalarType((Class<? extends Enum<?>>)enumType);
if (scalarType == null) {
// use JPA normal Enum type (without mapping)
EnumType type = enumerated != null ? enumerated.value() : null;