*
* @return a set of {@code ConfiguredClassHierarchy}s. One for each "leaf" entity.
*/
public static EmbeddableHierarchy createEmbeddableHierarchy(Class<?> embeddableClass, String propertyName, AccessType accessType, AnnotationBindingContext context) {
ClassInfo embeddableClassInfo = context.getClassInfo( embeddableClass.getName() );
if ( embeddableClassInfo == null ) {
throw new AssertionFailure(
String.format(
"The specified class %s cannot be found in the annotation index",
embeddableClass.getName()
)
);
}
if ( JandexHelper.getSingleAnnotation( embeddableClassInfo, JPADotNames.EMBEDDABLE ) == null ) {
throw new AssertionFailure(
String.format(
"The specified class %s is not annotated with @Embeddable even though it is as embeddable",
embeddableClass.getName()
)
);
}
List<ClassInfo> classInfoList = new ArrayList<ClassInfo>();
ClassInfo tmpClassInfo;
Class<?> clazz = embeddableClass;
while ( clazz != null && !clazz.equals( Object.class ) ) {
tmpClassInfo = context.getIndex().getClassByName( DotName.createSimple( clazz.getName() ) );
clazz = clazz.getSuperclass();
if ( tmpClassInfo == null ) {