use of jakarta.persistence.NamedAttributeNode in project hibernate-orm by hibernate.
the class JpaMetamodelImpl method applyNamedAttributeNodes.
private void applyNamedAttributeNodes(NamedAttributeNode[] namedAttributeNodes, NamedEntityGraph namedEntityGraph, GraphImplementor<?> graphNode) {
for (NamedAttributeNode namedAttributeNode : namedAttributeNodes) {
final String value = namedAttributeNode.value();
AttributeNodeImplementor<?> attributeNode = graphNode.addAttributeNode(value);
if (StringHelper.isNotEmpty(namedAttributeNode.subgraph())) {
final SubGraphImplementor<?> subgraph = attributeNode.makeSubGraph();
applyNamedSubgraphs(namedEntityGraph, namedAttributeNode.subgraph(), subgraph);
}
if (StringHelper.isNotEmpty(namedAttributeNode.keySubgraph())) {
final SubGraphImplementor<?> subgraph = attributeNode.makeKeySubGraph();
applyNamedSubgraphs(namedEntityGraph, namedAttributeNode.keySubgraph(), subgraph);
}
}
}
use of jakarta.persistence.NamedAttributeNode 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()]));
}
Aggregations