// Remove the accessor from other maps if the type changed.
removeEmbeddableAccessor(metadataClass);
removeMappedSuperclassAccessor(metadataClass);
if (project.hasEntity(metadataClass)) {
EntityAccessor entityAccessor = project.getEntityAccessor(metadataClass);
// If it was loaded from XML, reset the pre-processed flag.
if (entityAccessor.loadedFromXML()) {
entityAccessor.clearPreProcessed();
} else {
// Was not loaded from XML and existed in the project.
if (excludeUnlistedClasses(metadataClass)) {
// Exclude unlisted classes is now false, remove it!
removeEntityAccessor(metadataClass);
} else {
// Otherwise, override the existing accessor!
project.addEntityAccessor(new EntityAccessor(metadataClass.getAnnotation(JPA_ENTITY), metadataClass, project));
}
}
} else if (! excludeUnlistedClasses(metadataClass)) {
// add it!
project.addEntityAccessor(new EntityAccessor(metadataClass.getAnnotation(JPA_ENTITY), metadataClass, project));
}
}