Examples of AttributeGroup


Examples of org.eclipse.persistence.queries.AttributeGroup

            //Check for attributeGroups
            Map<String, AttributeGroup> childGroups = ((XMLDescriptor)descriptor).getAttributeGroups();
            Map<String, AttributeGroup> parentGroups = ((XMLDescriptor)rootDescriptor).getAttributeGroups();
            if(childGroups != null && !(childGroups.isEmpty()) && parentGroups != null && !(parentGroups.isEmpty())) {
                for(String nextKey:childGroups.keySet()) {
                    AttributeGroup parentGroup = parentGroups.get(nextKey);
                    if(parentGroup != null) {
                        AttributeGroup childGroup = childGroups.get(nextKey);
                        parentGroup.getSubClassGroups().put(descriptor.getJavaClassName(), childGroup);
                    }
                }
            }
        }
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

    public AttributeGroup getGroup(Class type) {
        if (this.subGroups == null || type == null){
            return null;
        }
        AttributeGroup result = this.subGroups.get(type);
        while(result == null && !type.equals(ClassConstants.Object_Class)){
            type = type.getSuperclass();
            if (type == null){
                throw new IllegalArgumentException(ExceptionLocalization.buildMessage("subclass_sought_not_a_managed_type", new Object[]{type.toString(), this.attributeName}));
            }
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

     * @return true if the group is the new root.
     */
    public static boolean orderInheritance(AttributeGroup group, Map<Object, AttributeGroup> subGroups) {
        Class type = group.getType();
        if (type != null){
            AttributeGroup superClass = null;
            while (!type.equals(ClassConstants.Object_Class) && superClass == null){
                type = type.getSuperclass();
                superClass = subGroups.get(type);
            }
            if (superClass != null){
                superClass.insertSubClass(group);
            }else{
                return true;
            }
        }
        return false;
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

    public AttributeGroup getKeyGroup(Class type) {
        if (this.keyGroups == null || type == null){
            return null;
        }
        AttributeGroup result = this.keyGroups.get(type);
        while(result == null && !type.equals(ClassConstants.Object_Class)){
            type = type.getSuperclass();
            if (type == null){
                throw new IllegalArgumentException(ExceptionLocalization.buildMessage("subclass_sought_not_a_managed_type", new Object[]{type.toString(), this.attributeName}));
            }
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

                if (anotherItem.subGroups == null){
                    return false;
                }
                if (this.subGroups.size() == anotherItem.subGroups.size()){
                    for (Map.Entry<Object, AttributeGroup> entry : this.subGroups.entrySet()){
                        AttributeGroup anotherGroup = anotherItem.subGroups.get(entry.getKey());
                        if (! entry.getValue().equals(anotherGroup)){
                            return false;
                        }
                    }
                }else{
                    return false;
                }
            } else if (anotherItem.subGroups != null){
                return false;
            }
           
            if(this.keyGroups != null) {
                if (anotherItem.keyGroups == null){
                    return false;
                }
                if (this.keyGroups.size() == anotherItem.keyGroups.size()){
                    for (Map.Entry<Object, AttributeGroup> entry : this.keyGroups.entrySet()){
                        AttributeGroup anotherGroup = anotherItem.keyGroups.get(entry.getKey());
                        if (! entry.getValue().equals(anotherGroup)){
                            return false;
                        }
                    }
                }else{
View Full Code Here

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

Examples of org.eclipse.persistence.queries.AttributeGroup

       
        // 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

Examples of org.eclipse.persistence.queries.AttributeGroup

        }
        setCurrentMapping(mapping);
        // aggregate descriptors are passed in because they could be part of an inheritance tree
        setCurrentDescriptor(descriptor);
       
        AttributeGroup currentGroupOriginal = null;
        AttributeItem currentItemOriginal = null;
        if(this.usesGroup) {
            currentGroupOriginal = this.currentGroup;
            currentItemOriginal = this.currentItem;
            this.currentGroup = this.currentItem.getGroup();
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

        }
        setCurrentMapping(mapping);
        setCurrentDescriptor(null);

        if (shouldIterateOnPrimitives()) {// false by default
            AttributeGroup currentGroupOriginal = null;
            AttributeItem currentItemOriginal = null;
            if(this.usesGroup) {
                currentGroupOriginal = this.currentGroup;
                currentItemOriginal = this.currentItem;
                this.currentGroup = this.currentItem.getGroup();
View Full Code Here

Examples of org.eclipse.persistence.queries.AttributeGroup

            getVisitedObjects().put(referenceObject, referenceObject);
        }
        setCurrentMapping(mapping);
        setCurrentDescriptor(getDescriptorFor(referenceObject));

        AttributeGroup currentGroupOriginal = null;
        AttributeItem currentItemOriginal = null;
        if(this.usesGroup) {
            currentGroupOriginal = this.currentGroup;
            currentItemOriginal = this.currentItem;
            this.currentGroup = this.currentItem.getGroup();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.