use of jakarta.persistence.MappedSuperclass in project hibernate-orm by hibernate.
the class AnnotationMetadataSourceProcessorImpl method insertMappedSuperclasses.
private void insertMappedSuperclasses(List<XClass> original, List<XClass> copy) {
final boolean debug = log.isDebugEnabled();
for (XClass clazz : original) {
if (clazz.isAnnotationPresent(jakarta.persistence.MappedSuperclass.class)) {
if (debug) {
log.debugf("Skipping explicit MappedSuperclass %s, the class will be discovered analyzing the implementing class", clazz);
}
} else {
copy.add(clazz);
XClass superClass = clazz.getSuperclass();
while (superClass != null && !reflectionManager.equals(superClass, Object.class) && !copy.contains(superClass)) {
if (superClass.isAnnotationPresent(Entity.class) || superClass.isAnnotationPresent(jakarta.persistence.MappedSuperclass.class)) {
copy.add(superClass);
}
superClass = superClass.getSuperclass();
}
}
}
}
use of jakarta.persistence.MappedSuperclass in project hibernate-orm by hibernate.
the class InheritanceState method extractInheritanceType.
private void extractInheritanceType() {
XAnnotatedElement element = getClazz();
Inheritance inhAnn = element.getAnnotation(Inheritance.class);
MappedSuperclass mappedSuperClass = element.getAnnotation(MappedSuperclass.class);
if (mappedSuperClass != null) {
setEmbeddableSuperclass(true);
setType(inhAnn == null ? null : inhAnn.strategy());
} else {
setType(inhAnn == null ? InheritanceType.SINGLE_TABLE : inhAnn.strategy());
}
}
Aggregations