log.debug("Validate parameterized types for property {} of entity class {}", field.getName(),
entityClass.getCanonicalName());
Type genericType = field.getGenericType();
if (!(genericType instanceof ParameterizedType)) {
throw new AchillesBeanMappingException("The Map type should be parameterized for the entity '"
+ entityClass.getCanonicalName() + "'");
} else {
ParameterizedType pt = (ParameterizedType) genericType;
Type[] actualTypeArguments = pt.getActualTypeArguments();
if (actualTypeArguments.length <= 1) {
throw new AchillesBeanMappingException(
"The Map type should be parameterized with <K,V> for the entity '"
+ entityClass.getCanonicalName() + "'");
}
}
}