use of javax.persistence.NamedAttributeNode in project hibernate-orm by hibernate.
the class MetamodelImpl method applyNamedAttributeNodes.
private void applyNamedAttributeNodes(NamedAttributeNode[] namedAttributeNodes, NamedEntityGraph namedEntityGraph, AbstractGraphNode graphNode) {
for (NamedAttributeNode namedAttributeNode : namedAttributeNodes) {
final String value = namedAttributeNode.value();
AttributeNodeImpl attributeNode = graphNode.addAttribute(value);
if (StringHelper.isNotEmpty(namedAttributeNode.subgraph())) {
final SubgraphImpl subgraph = attributeNode.makeSubgraph();
applyNamedSubgraphs(namedEntityGraph, namedAttributeNode.subgraph(), subgraph);
}
if (StringHelper.isNotEmpty(namedAttributeNode.keySubgraph())) {
final SubgraphImpl subgraph = attributeNode.makeKeySubgraph();
applyNamedSubgraphs(namedEntityGraph, namedAttributeNode.keySubgraph(), subgraph);
}
}
}
use of javax.persistence.NamedAttributeNode in project hibernate-orm by hibernate.
the class JPAOverriddenAnnotationReader method bindNamedAttributeNodes.
private static void bindNamedAttributeNodes(Element subElement, AnnotationDescriptor ann) {
List<Element> namedAttributeNodes = subElement.elements("named-attribute-node");
List<NamedAttributeNode> annNamedAttributeNodes = new ArrayList<>();
for (Element namedAttributeNode : namedAttributeNodes) {
AnnotationDescriptor annNamedAttributeNode = new AnnotationDescriptor(NamedAttributeNode.class);
copyStringAttribute(annNamedAttributeNode, namedAttributeNode, "value", "name", true);
copyStringAttribute(annNamedAttributeNode, namedAttributeNode, "subgraph", false);
copyStringAttribute(annNamedAttributeNode, namedAttributeNode, "key-subgraph", false);
annNamedAttributeNodes.add(AnnotationFactory.create(annNamedAttributeNode));
}
ann.setValue("attributeNodes", annNamedAttributeNodes.toArray(new NamedAttributeNode[annNamedAttributeNodes.size()]));
}
Aggregations