Package org.apache.cayenne

Examples of org.apache.cayenne.CayenneException


     * set up.
     */
    public void execute() throws CayenneException {
        // sanity check
        if (sourceNode == null) {
            throw new CayenneException("Can't port data, source node is null.");
        }

        if (destinationNode == null) {
            throw new CayenneException("Can't port data, destination node is null.");
        }

        // the simple equality check may actually detect problems with misconfigred nodes
        // it is not as dumb as it may look at first
        if (sourceNode == destinationNode) {
            throw new CayenneException(
                    "Can't port data, source and target nodes are the same.");
        }

        if (entities == null || entities.isEmpty()) {
            return;
View Full Code Here


        catch (CayenneException cex) {
            // rethrow unmodified
            throw cex;
        }
        catch (Exception otherex) {
            throw new CayenneException("Exception materializing column.", Util
                    .unwindException(otherex));
        }
    }
View Full Code Here

        }
        catch (CayenneException ex) {
            throw ex;
        }
        catch (Exception ex) {
            throw new CayenneException("Exception materializing row", Util
                    .unwindException(ex));
        }
    }
View Full Code Here

                QueryLogger.logRollbackTransaction("transaction rolledback.");
                if (deferredException instanceof SQLException) {
                    throw (SQLException) deferredException;
                }
                else {
                    throw new CayenneException(deferredException);
                }
            }
            else {
                QueryLogger.logCommitTransaction("transaction committed.");
            }
View Full Code Here

            if (deferredException != null) {
                if (deferredException instanceof SQLException) {
                    throw (SQLException) deferredException;
                }
                else {
                    throw new CayenneException(deferredException);
                }
            }
        }
    }
View Full Code Here

            if (entityQualifiers[i].match(discriminator)) {
                return entityReaders[i].readRow(resultSet);
            }
        }

        throw new CayenneException(
                "Row discriminator did not match any entities in the inheritance hierarchy: "
                        + discriminator);
    }
View Full Code Here

                tx.rollback();
            }
            catch (Exception rollbackEx) {
            }

            throw new CayenneException(e);
        }
        finally {
            if (Transaction.getThreadTransaction() == tx) {
                Transaction.bindThreadTransaction(null);
            }
View Full Code Here

        byte[] bytes = null;

        if (type == Types.BLOB) {
            if (!isUsingBlobs()) {
                throw new CayenneException(
                        "Binary streams are not supported in stored procedure parameters.");
            }
            bytes = readBlob(cs.getBlob(index));
        }
        else {
View Full Code Here

        String val = null;

        // CLOB handling
        if (type == Types.CLOB) {
            if (!isUsingClobs()) {
                throw new CayenneException(
                        "Character streams are not supported in stored procedure parameters.");
            }

            val = readClob(cs.getClob(index));
        }
View Full Code Here

        catch (CayenneException cex) {
            // rethrow unmodified
            throw cex;
        }
        catch (Exception otherex) {
            throw new CayenneException("Exception materializing column.", Util
                    .unwindException(otherex));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.CayenneException

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.