}
}
}
}
// remove all super types if their sub types are already contained in the type set
TypeMetadataSet<EntityTypeMetadata<EntityMetadata>> uniqueTypes = new TypeMetadataSet();
for (EntityTypeMetadata<EntityMetadata> entityTypeMetadata : allEntityTypeMetadatas) {
AnnotatedType annotatedType = entityTypeMetadata.getAnnotatedType();
boolean subtype = false;
for (Iterator<EntityTypeMetadata<EntityMetadata>> subTypeIterator = allEntityTypeMetadatas.iterator(); subTypeIterator.hasNext() && !subtype; ) {
AnnotatedType otherAnnotatedType = subTypeIterator.next().getAnnotatedType();
if (!annotatedType.equals(otherAnnotatedType) && annotatedType.getAnnotatedElement().isAssignableFrom(otherAnnotatedType.getAnnotatedElement())) {
subtype = true;
}
}
if (!subtype) {
uniqueTypes.add(entityTypeMetadata);
}
}
return uniqueTypes;
}