mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-7622: Added check for invalid extensions of an entity class when building the entity hierarchies
This commit is contained in:
parent
4d0f01614a
commit
386a7c2f0d
@ -236,6 +236,15 @@ private static void processHierarchy(AnnotationBindingContext bindingContext,
|
||||
}
|
||||
|
||||
for ( ClassInfo subClassInfo : subClasses ) {
|
||||
if ( !isEntityClass( subClassInfo ) ) {
|
||||
if ( JandexHelper.containsSingleAnnotation( subClassInfo, JPADotNames.EMBEDDABLE ) ) {
|
||||
throw new AnnotationException( "An embeddable cannot extend an entity: " + subClassInfo );
|
||||
}
|
||||
if ( JandexHelper.containsSingleAnnotation( subClassInfo, JPADotNames.MAPPED_SUPERCLASS ) ) {
|
||||
throw new AnnotationException( "A mapped superclass cannot extend an entity: " + subClassInfo );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
addSubClassToSubclassMap( classInfo.name(), subClassInfo, classToDirectSubclassMap );
|
||||
processHierarchy(
|
||||
bindingContext,
|
||||
|
@ -22,7 +22,7 @@
|
||||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@Embeddable
|
||||
public class Closet extends Furniture {
|
||||
public class Closet extends Woody {
|
||||
int numberOfDoors;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user