Some tweaks to handling collections and enums.

Fixed isAssignableFrom(…) usage in BasicPersistentProperty to correctly detect collections and maps. Let MappingBeanHelper treat enums as simple types as well.
This commit is contained in:
Oliver Gierke
2011-03-16 18:17:14 +01:00
parent bc6e9d8f54
commit 8ab42a266c
2 changed files with 3 additions and 3 deletions

View File

@@ -128,13 +128,13 @@ public class BasicPersistentProperty implements PersistentProperty {
@Override
public boolean isCollection() {
return getType().isAssignableFrom(Collection.class) || getType().isAssignableFrom(List.class) || isArray();
return Collection.class.isAssignableFrom(getType()) || isArray();
}
@Override
public boolean isMap() {
return getType().isAssignableFrom(Map.class);
return Map.class.isAssignableFrom(getType());
}
/* (non-Javadoc)

View File

@@ -84,7 +84,7 @@ public abstract class MappingBeanHelper {
return true;
}
}
return false;
return type.isEnum();
}
public static <T> T constructInstance(PersistentEntity<T> entity,