Package org.apache.cayenne.access

Examples of org.apache.cayenne.access.DataDomain


        return domain;
    }

    protected DataMap findMap(String domainName, String mapName) throws FindException {
        DataDomain domain = findDomain(domainName);
        DataMap map = domain.getMap(mapName);
        if (map == null) {
            throw new FindException("Can't find DataMap: " + mapName);
        }

        return map;
View Full Code Here


        return map;
    }

    protected DataNode findNode(String domainName, String nodeName) throws FindException {
        DataDomain domain = findDomain(domainName);
        DataNode node = domain.getNode(nodeName);
        if (node == null) {
            throw new FindException("Can't find DataNode: " + nodeName);
        }

        return node;
View Full Code Here

            Map<String, String> properties) {
        if (properties == null || properties.isEmpty()) {
            return;
        }

        DataDomain domain = null;
        try {
            domain = findDomain(domainName);
        }
        catch (FindException ex) {
            logger.info("Error: Domain is not loaded: " + domainName);
            throw new ConfigurationException("Domain is not loaded: " + domainName);
        }

        domain.initWithProperties(properties);
    }
View Full Code Here

            logger.info("Error: unnamed <domain>.");
            throw new ConfigurationException("Domain 'name' attribute must be not null.");
        }

        logger.info("loaded domain: " + domainName);
        domains.put(domainName, new DataDomain(domainName));
    }
View Full Code Here

    public void shouldLoadDataMaps(String domainName, Map<String, DataMap> locations) {
        if (locations.size() == 0) {
            return;
        }

        DataDomain domain = null;
        try {
            domain = findDomain(domainName);
        }
        catch (FindException ex) {
            logger.info("Error: Domain is not loaded: " + domainName);
            throw new ConfigurationException("Domain is not loaded: " + domainName);
        }

        // load DataMaps tree
        for (String name : locations.keySet()) {
            DataMap map = domain.getMap(name);
            if (map != null) {
                continue;
            }

            loadDataMap(domain, name, locations);
View Full Code Here

        if (sort) {
            domains = Util.sortedIterator(domains, ProjectTraversal.dataDomainComparator);
        }

        while (domains.hasNext()) {
            DataDomain domain = (DataDomain) domains.next();
            ProjectPath domainPath = path.appendToPath(domain);
            handler.projectNode(domainPath);

            if (handler.shouldReadChildren(domain, path)) {
                this.traverseMaps(domain.getDataMaps().iterator(), domainPath);
                this.traverseNodes(domain.getDataNodes().iterator(), domainPath);
            }
        }
    }
View Full Code Here

        if (sort) {
            domains = Util.sortedIterator(domains, ProjectTraversal.dataDomainComparator);
        }

        while (domains.hasNext()) {
            DataDomain domain = (DataDomain) domains.next();
            ProjectPath domainPath = path.appendToPath(domain);
            handler.projectNode(domainPath);

            if (handler.shouldReadChildren(domain, path)) {
                this.traverseMaps(domain.getDataMaps().iterator(), domainPath);
                this.traverseNodes(domain.getDataNodes().iterator(), domainPath);
            }
        }
    }
View Full Code Here

            return "UntitledDomain";
        }

        @Override
        protected Object create(String name, Object namingContext) {
            return new DataDomain(name);
        }
View Full Code Here

            // top level object of the project
            if (namingContext == null) {
                return false;
            }

            DataDomain domain = (DataDomain) namingContext;
            return domain.getMap(name) != null;
        }
View Full Code Here

            return new DataNode(name);
        }

        @Override
        protected boolean isNameInUse(String name, Object namingContext) {
            DataDomain domain = (DataDomain) namingContext;
            return domain.getNode(name) != null;
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.access.DataDomain

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.