Examples of DataDomain


Examples of org.apache.cayenne.access.DataDomain

     * Normally Cayenne applications don't need to access DataSource or any other JDBC
     * code directly, however in some unusual conditions it may be needed, and this method
     * provides a shortcut to raw JDBC.
     */
    public DataSource getDataSource(String dataNodeName) {
        DataDomain domain = getDataDomain();

        if (dataNodeName != null) {
            DataNode node = domain.getNode(dataNodeName);
            if (node == null) {
                throw new IllegalArgumentException("Unknown DataNode name: "
                        + dataNodeName);
            }

            return node.getDataSource();
        }

        else {
            Collection<DataNode> nodes = domain.getDataNodes();
            if (nodes.size() != 1) {
                throw new IllegalArgumentException(
                        "If DataNode name is not specified, DataDomain must have exactly 1 DataNode. Actual node count: "
                                + nodes.size());
            }
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.