}
for (MappingAccessor mappingAccessor : accessor.getDescriptor().getAccessors()) {
if (! mappingAccessor.isTransient()) {
MetadataAnnotatedElement annotatedElement = mappingAccessor.getAnnotatedElement();
MetadataClass rawClass = annotatedElement.getRawClass(mappingAccessor.getDescriptor());
// NOTE: order of checking is important.
String attributeType;
String types = className;
if (mappingAccessor.isBasic()) {
types = types + ", " + getUnqualifiedType(getBoxedType(annotatedElement), imports);
attributeType = AttributeType.SingularAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.SingularAttribute");
} else {
if (rawClass.isList()) {
attributeType = AttributeType.ListAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.ListAttribute");
} else if (rawClass.isSet()) {
attributeType = AttributeType.SetAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.SetAttribute");
} else if (rawClass.isMap()) {
attributeType = AttributeType.MapAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.MapAttribute");
} else if (rawClass.isCollection()) {
attributeType = AttributeType.CollectionAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.CollectionAttribute");
} else {
attributeType = AttributeType.SingularAttribute.name();
imports.put(attributeType, "javax.persistence.metamodel.SingularAttribute");
}
if (mappingAccessor.isMapAccessor()) {
if (mappingAccessor.isMappedKeyMapAccessor()) {
MetadataClass mapKeyClass = ((MappedKeyMapAccessor) mappingAccessor).getMapKeyClass();
types = types + ", " + getUnqualifiedType(mapKeyClass.getName(), imports) + ", " + getUnqualifiedType(mappingAccessor.getReferenceClassName(), imports);
} else {
String mapKeyType;
if (annotatedElement.isGenericCollectionType()) {
// Grab the map key class from the generic.
mapKeyType = annotatedElement.getGenericType().get(1);