Search in sources :

Example 1 with JaxbNamedEntityGraph

use of org.hibernate.boot.jaxb.mapping.spi.JaxbNamedEntityGraph in project hibernate-orm by hibernate.

the class JPAXMLOverriddenAnnotationReader method buildNamedEntityGraph.

public static List<NamedEntityGraph> buildNamedEntityGraph(List<JaxbNamedEntityGraph> elements, XMLContext.Default defaults, ClassLoaderAccess classLoaderAccess) {
    List<NamedEntityGraph> namedEntityGraphList = new ArrayList<>();
    for (JaxbNamedEntityGraph element : elements) {
        AnnotationDescriptor ann = new AnnotationDescriptor(NamedEntityGraph.class);
        copyAttribute(ann, "name", element.getName(), false);
        copyAttribute(ann, "include-all-attributes", element.isIncludeAllAttributes(), false);
        bindNamedAttributeNodes(element.getNamedAttributeNode(), ann);
        bindNamedSubgraph(defaults, ann, "subgraphs", element.getSubgraph(), classLoaderAccess);
        bindNamedSubgraph(defaults, ann, "subclassSubgraphs", element.getSubclassSubgraph(), classLoaderAccess);
        namedEntityGraphList.add(AnnotationFactory.create(ann));
    }
    // TODO
    return namedEntityGraphList;
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) JaxbNamedEntityGraph(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedEntityGraph) NamedEntityGraph(jakarta.persistence.NamedEntityGraph) JaxbNamedEntityGraph(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedEntityGraph) ArrayList(java.util.ArrayList)

Aggregations

NamedEntityGraph (jakarta.persistence.NamedEntityGraph)1 ArrayList (java.util.ArrayList)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbNamedEntityGraph (org.hibernate.boot.jaxb.mapping.spi.JaxbNamedEntityGraph)1