Examples of ObjectPersistenceException


Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

                }
                rows.add(row);
            }
           
        } catch (SQLException ex) {
            throw new ObjectPersistenceException("Failed to executeSql: " + sql, ex);
        } finally {
            closeSafely(statement);
        }

        return rows;
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

        try {
            statement = connection.createStatement();
            return statement.executeUpdate(sql);
           
        } catch (SQLException ex) {
            throw new ObjectPersistenceException("Failed to executeSql: " + sql, ex);
        } finally {
            closeSafely(statement);
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

    private SaveObjectCommand createSaveCommandThatAborts(final ObjectAdapter object, final String name) {
        return new SaveObjectCommand() {
            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
                throw new ObjectPersistenceException();
            }

            @Override
            public ObjectAdapter onAdapter() {
                return object;
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

        if(!commands.isEmpty()) {
            // must have hit max flush
            final List<PersistenceCommand> commandsStillToFlush =
                    Collections.unmodifiableList(Lists.newArrayList(commands));
            commands.clear();
            throw new ObjectPersistenceException("Failed to flush transaction after " + MAX_FLUSH_ATTEMPTS + " attempts; commands still to flush:\n " + commandsStillToFlush.toString());
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

                }
                rows.add(row);
            }
           
        } catch (SQLException ex) {
            throw new ObjectPersistenceException("Failed to executeSql: " + sql, ex);
        } finally {
            closeSafely(statement);
        }

        return rows;
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

        try {
            statement = connection.createStatement();
            return statement.executeUpdate(sql);
           
        } catch (SQLException ex) {
            throw new ObjectPersistenceException("Failed to executeSql: " + sql, ex);
        } finally {
            closeSafely(statement);
        }
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException

            xml.append("  <multiple-association field=\"" + field + "\" ");
            xml.append(">\n");
            for (int i = 0; i < size; i++) {
                final Object oid = references.elementAt(i);
                if (((SerialOid) oid).isTransient()) {
                    throw new ObjectPersistenceException("Can't add tranisent OID (" + oid + ") to " + field + " element.");
                }
                xml.append("    <element ");
                xml.append("ref=\"" + encodedOid((SerialOid) oid) + "\"/>\n");
            }
            xml.append("  </multiple-association>\n");
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException

    private SaveObjectCommand createCommandThatAborts(final ObjectAdapter object, final String name) {
        return new SaveObjectCommand() {
            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
                throw new ObjectPersistenceException();
            }

            @Override
            public ObjectAdapter onObject() {
                return object;
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException

                if (field.isNotPersisted()) {
                    continue;
                } else if (field instanceof OneToManyAssociation) {
                    final ObjectAdapter collection = field.get(object);
                    if (collection == null) {
                        throw new ObjectPersistenceException("Collection " + field.getName() + " does not exist in " + object.getSpecification().getFullIdentifier());
                    }
                    makePersistent(collection, toPersistObjectSet);
                } else {
                    final ObjectAdapter fieldValue = field.get(object);
                    if (fieldValue == null) {
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException

                    continue;
                }
                if (field.isOneToManyAssociation()) {
                    final ObjectAdapter collection = field.get(object);
                    if (collection == null) {
                        throw new ObjectPersistenceException("Collection " + field.getName() + " does not exist in " + object.getSpecification().getFullIdentifier());
                    }
                    makePersistent(collection, toPersistObjectSet);
                } else {
                    final ObjectAdapter fieldValue = field.get(object);
                    if (fieldValue == null) {
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.