Package org.apache.cayenne

Examples of org.apache.cayenne.CayenneRuntimeException


    /**
     * @since 1.2
     */
    public void setObjectId(ObjectId id) {
        if (id == null) {
            throw new CayenneRuntimeException(
                    "Null ObjectId, probably an attempt to use TRANSIENT object as a query parameter.");
        }
        else if (id.isTemporary()) {
            throw new CayenneRuntimeException(
                    "Temporary id, probably an attempt to use NEW object as a query parameter.");
        }
        else {
            values = id.getIdSnapshot();
        }
View Full Code Here


            // and *don't* do it again
            return false;
        }

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

        if (object.getObjectContext() != dataContext) {
            throw new CayenneRuntimeException(
                    "Attempt to delete object registered 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

            }
            else if (exp.getType() == Expression.DB_PATH) {
                appendDbPath(exp);
            }
            else {
                throw new CayenneRuntimeException("Unsupported ordering expression: "
                        + exp);
            }

            // Close UPPER() modifier
            if (ord.isCaseInsensitive()) {
View Full Code Here

        Map updAttrs = query.getUpdAttributes();
        // set of keys.. each key is supposed to be ObjAttribute
        Iterator attrIt = updAttrs.entrySet().iterator();

        if (!attrIt.hasNext())
            throw new CayenneRuntimeException("Nothing to update.");

        DbEntity dbEnt = getRootEntity().getDbEntity();
        queryBuf.append(" SET ");

        // append updated attribute values
View Full Code Here

     * Overrides superclass implementation to rethrow an exception immediately.
     */
    @Override
    public void nextQueryException(Query query, Exception ex) {
        super.nextQueryException(query, ex);
        throw new CayenneRuntimeException("Query exception.", Util.unwindException(ex));
    }
View Full Code Here

     * Overrides superclass implementation to rethrow an exception immediately.
     */
    @Override
    public void nextGlobalException(Exception ex) {
        super.nextGlobalException(ex);
        throw new CayenneRuntimeException("Global exception.", Util.unwindException(ex));
    }
View Full Code Here

        list.add(dataRows);
    }

    @Override
    public void nextDataRows(Query q, ResultIterator it) {
        throw new CayenneRuntimeException("Iterated results are not supported by "
                + this.getClass().getName());
    }
View Full Code Here

                        out.append(" AND ");
                    break;
            }
        }
        catch (IOException ioex) {
            throw new CayenneRuntimeException("Error appending content", ioex);
        }

        if (matchingObject) {
            objectMatchTranslator.setOperation(out.toString());
            objectMatchTranslator.setExpression(node);
View Full Code Here

                    || node.getType() == Expression.NOT_LIKE_IGNORE_CASE) {
                out.append("UPPER(");
            }
        }
        catch (IOException ioex) {
            throw new CayenneRuntimeException("Error appending content", ioex);
        }
    }
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.