Set<? extends Element> members = handler.getPersistentMembers(e);
for (Element m : members) {
boolean isPersistentCollection = m.getAnnotation(PersistentCollection.class) != null;
TypeMirror decl = handler.getDeclaredType(m);
String fieldName = handler.getPersistentMemberName(m);
String fieldType = handler.getDeclaredTypeName(decl, true, isPersistentCollection);
TypeCategory typeCategory =
toMetaModelTypeCategory(decl, fieldType, isPersistentCollection);
String metaModelType = typeCategory.getMetaModelType();
SourceCode.Field modelField = null;
switch (typeCategory) {
case ATTRIBUTE:
modelField = modelClass.addField(fieldName, metaModelType);
modelField.addParameter(originalSimpleClass)
.addParameter(fieldType);
break;
case COLLECTION:
case LIST:
case SET:
TypeMirror param = handler.getTypeParameter(m, decl, 0, true);
String elementType = handler.getDeclaredTypeName(param);
modelField = modelClass.addField(fieldName, metaModelType);
modelField.addParameter(originalSimpleClass)
.addParameter(elementType);
break;
case MAP:
TypeMirror key = handler.getTypeParameter(m, decl, 0, false);
TypeMirror value = handler.getTypeParameter(m, decl, 1, true);
String keyType = handler.getDeclaredTypeName(key);
String valueType = handler.getDeclaredTypeName(value);
modelField = modelClass.addField(fieldName, metaModelType);
modelField.addParameter(originalSimpleClass)
.addParameter(keyType)