Package org.apache.cayenne

Examples of org.apache.cayenne.CayenneRuntimeException


        try {
            String parentClass = listRoot.getAttribute("type");
            ret = (List) Class.forName(parentClass).newInstance();
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException(
                    "Could not create collection with no-arg constructor.",
                    ex);
        }

        XMLMappingDescriptor mu = null;
View Full Code Here


        try {
            return builder.parse(new InputSource(in));
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException("Error parsing XML", ex);
        }
    }
View Full Code Here

        Document document;
        try {
            document = builder.parse(mappingUrl);
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException("Error parsing XML at " + mappingUrl, ex);
        }

        Element root = document.getDocumentElement();

        if (!"model".equals(root.getNodeName())) {
            throw new CayenneRuntimeException(
                    "Root of the mapping model must be \"model\"");
        }

        Map entities = new HashMap();
        Iterator it = XMLUtil.getChildren(root).iterator();
View Full Code Here

                    className,
                    true,
                    Thread.currentThread().getContextClassLoader()).newInstance();
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException("Error creating instance of class "
                    + className, ex);
        }

        NamedNodeMap attributes = objectData.getAttributes();
        for (int i = 0; i < attributes.getLength(); i++) {
View Full Code Here

                        subjects,
                        externalSubject,
                        properties);
            }
            catch (Exception ex) {
                throw new CayenneRuntimeException("Error initializing DataRowStore.", ex);
            }

            startListeners();
        }
    }
View Full Code Here

        }
        else if (engine instanceof DataContext) {
            return getSnapshot(oid, ((DataContext) engine).getChannel());
        }

        throw new CayenneRuntimeException(
                "QueryEngine is not an DataChannel or DataContext: " + engine);
    }
View Full Code Here

        Query query = new ObjectIdQuery(oid, true, ObjectIdQuery.CACHE_REFRESH);
        List results = channel.onQuery(null, query).firstList();

        if (results.size() > 1) {
            throw new CayenneRuntimeException("More than 1 object found for ObjectId "
                    + oid
                    + ". Fetch matched "
                    + results.size()
                    + " objects.");
        }
View Full Code Here

                remoteNotificationsHandler.startup(
                        eventManager,
                        EventBridge.RECEIVE_LOCAL_EXTERNAL);
            }
            catch (Exception ex) {
                throw new CayenneRuntimeException("Error initializing DataRowStore.", ex);
            }
        }
    }
View Full Code Here

        }

        DataObject dataObject = (DataObject) object;

        if (dataObject.getDataContext() == null) {
            throw new CayenneRuntimeException(
                    "Attempt to delete unregistered non-TRANSIENT object: " + object);
        }

        if (dataObject.getDataContext() != dataContext) {
            throw new CayenneRuntimeException(
                    "Attempt to delete object regsitered in a different DataContext. Object: "
                            + object
                            + ", data context: "
                            + dataContext);
        }
View Full Code Here

                    }

                    break;
                default:
                    object.setPersistenceState(oldState);
                    throw new CayenneRuntimeException("Invalid delete rule "
                            + relationship.getDeleteRule());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.CayenneRuntimeException

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.