Package org.eclipse.persistence.queries

Examples of org.eclipse.persistence.queries.AttributeGroup


    /**
     * INTERNAL:
     * Process the named subgraph metadata into a new attribute group.
     */
    public void process(Map<String, Map<String, AttributeGroup>> attributeGraphs) {
        AttributeGroup attributeGraph = new AttributeGroup(getName(), getTypeClassName(), true);
               
        if (! attributeGraphs.containsKey(getName())) {
            attributeGraphs.put(getName(), new HashMap<String, AttributeGroup>());
        }
       
View Full Code Here


       
        // Check for an existing entity graph and throw an exception if there is one.
        if (getProject().hasEntityGraph(entityGraphName)) {
            throw new IllegalStateException(ExceptionLocalization.buildMessage("named_entity_graph_exists", new Object[]{ entityGraphName, entityAccessor.getJavaClassName()}));
        } else {
            AttributeGroup entityGraph = new AttributeGroup(entityGraphName, entityAccessor.getJavaClassName(), true);
            Map<String, Map<String, AttributeGroup>> attributeGraphs = new HashMap<String, Map<String, AttributeGroup>>();
       
            // Process the subgraph metadata (build attribute graphs for each).
            for (NamedSubgraphMetadata subgraph : getSubgraphs()) {
                subgraph.process(attributeGraphs);
            }
       
            // Process the include all attributes flag.
            if (includeAllAttributes()) {
                for (MappingAccessor accessor : entityAccessor.getDescriptor().getMappingAccessors()) {
                    entityGraph.addAttribute(accessor.getAttributeName());
                }
            }
       
            // Process the attribute nodes.
            for (NamedAttributeNodeMetadata attributeNode : getNamedAttributeNodes()) {
                attributeNode.process(attributeGraphs, entityGraph, entityGraph);
            }

            // Process the subgraphs attribute nodes (into the groups built previously).
            for (NamedSubgraphMetadata subgraph : getSubgraphs()) {
                subgraph.processAttributeNodes(attributeGraphs, attributeGraphs.get(subgraph.getName()).get(subgraph.getTypeClassName()), entityGraph);
            }
           
            for (NamedSubgraphMetadata subclassSubgraph : getSubclassSubgraphs()){
                AttributeGroup group = new AttributeGroup(subclassSubgraph.getName(), subclassSubgraph.getTypeClassName(), true);
                subclassSubgraph.processAttributeNodes(attributeGraphs, group, entityGraph);
                entityGraph.getSubClassGroups().put(group.getTypeName(), group);
            }
   
            // Finally, add the entity graph to the project.
            getProject().addEntityGraph(entityGraph);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.queries.AttributeGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.