use of jakarta.persistence.NamedSubgraph in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method bindNamedSubgraph.
private static void bindNamedSubgraph(XMLContext.Default defaults, AnnotationDescriptor ann, String annotationAttributeName, List<JaxbNamedSubgraph> subgraphNodes, ClassLoaderAccess classLoaderAccess) {
List<NamedSubgraph> annSubgraphNodes = new ArrayList<>();
for (JaxbNamedSubgraph subgraphNode : subgraphNodes) {
AnnotationDescriptor annSubgraphNode = new AnnotationDescriptor(NamedSubgraph.class);
copyAttribute(annSubgraphNode, "name", subgraphNode.getName(), true);
String clazzName = subgraphNode.getClazz();
Class clazz;
try {
clazz = classLoaderAccess.classForName(XMLContext.buildSafeClassName(clazzName, defaults));
} catch (ClassLoadingException e) {
throw new AnnotationException("Unable to find entity-class: " + clazzName, e);
}
annSubgraphNode.setValue("type", clazz);
bindNamedAttributeNodes(subgraphNode.getNamedAttributeNode(), annSubgraphNode);
annSubgraphNodes.add(AnnotationFactory.create(annSubgraphNode));
}
ann.setValue(annotationAttributeName, annSubgraphNodes.toArray(new NamedSubgraph[annSubgraphNodes.size()]));
}
Aggregations