Examples of DataDomain


Examples of org.apache.cayenne.access.DataDomain

            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

Examples of org.apache.cayenne.access.DataDomain

    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

Examples of org.apache.cayenne.access.DataDomain

     *
     * @return a pooled SQL connection
     * @throws SQLException if a database connection could not be obtained
     */
    protected Connection getConnection() throws SQLException {
        DataDomain domain = Configuration.getSharedConfiguration().getDomain();

        DataNode node = domain.getDataNodes().iterator().next();

        return node.getDataSource().getConnection();
    }
View Full Code Here

Examples of org.apache.cayenne.access.DataDomain

     * provided configuration object. Throws ProjectException if there is no
     * matching DataNode.
     */
    public DataNode findDataNode(Configuration config)
        throws ProjectException {
        DataDomain domainObj = null;

        // domain name is either explicit, or use default domain
        if (domain != null) {
            domainObj = config.getDomain(domain);

            if (domainObj == null) {
                throw new ProjectException("Can't find domain named " + domain);
            }
        } else {
            try {
                domainObj = config.getDomain();
            } catch (Exception ex) {
                throw new ProjectException("Project has no default domain.", ex);
            }

            if (domainObj == null) {
                throw new ProjectException("Project has no domains configured.");
            }
        }

        DataNode node = domainObj.getNode(name);
        if (node == null) {
            throw new ProjectException(
                "Domain "
                    + domainObj.getName()
                    + " has no node named '"
                    + name
                    + "'.");
        }
        return node;
View Full Code Here

Examples of org.apache.cayenne.access.DataDomain

        this.status = status;
    }

    protected DataDomain findDomain(String name) throws FindException {
        DataDomain domain = domains.get(name);
        if (domain == null) {
            throw new FindException("Can't find DataDomain: " + name);
        }

        return domain;
View Full Code Here

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

Examples of org.apache.cayenne.access.DataDomain

        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

Examples of org.apache.cayenne.access.DataDomain

    public void shouldLoadDataDomainProperties(String domainName, Map 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

Examples of org.apache.cayenne.access.DataDomain

            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

Examples of org.apache.cayenne.access.DataDomain

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