Search in sources :

Example 1 with JaxbNamedAttributeNode

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

the class JPAXMLOverriddenAnnotationReader method bindNamedAttributeNodes.

private static void bindNamedAttributeNodes(List<JaxbNamedAttributeNode> elements, AnnotationDescriptor ann) {
    List<NamedAttributeNode> annNamedAttributeNodes = new ArrayList<>();
    for (JaxbNamedAttributeNode element : elements) {
        AnnotationDescriptor annNamedAttributeNode = new AnnotationDescriptor(NamedAttributeNode.class);
        copyAttribute(annNamedAttributeNode, "value", "name", element.getName(), true);
        copyAttribute(annNamedAttributeNode, "subgraph", element.getSubgraph(), false);
        copyAttribute(annNamedAttributeNode, "key-subgraph", element.getKeySubgraph(), false);
        annNamedAttributeNodes.add(AnnotationFactory.create(annNamedAttributeNode));
    }
    ann.setValue("attributeNodes", annNamedAttributeNodes.toArray(new NamedAttributeNode[annNamedAttributeNodes.size()]));
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) ArrayList(java.util.ArrayList) JaxbNamedAttributeNode(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedAttributeNode) NamedAttributeNode(jakarta.persistence.NamedAttributeNode) JaxbNamedAttributeNode(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedAttributeNode)

Aggregations

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