Package org.apache.isis.core.runtime.persistence

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


        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

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

        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

    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

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

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

        return rows;
View Full Code Here

        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

            writer.append(">\n");
            for (int i = 0; i < size; i++) {
                final Object oid = references.elementAt(i);
                final RootOidDefault rootOidDefault = (RootOidDefault) oid;
                if (rootOidDefault.isTransient()) {
                    throw new ObjectPersistenceException("Can't add tranisent OID (" + oid + ") to " + field + " element.");
                }
                writer.append("    <element ");
                Utils.appendAttribute(writer, "oid", rootOidDefault.enString(getOidMarshaller()));
                writer.append("/>\n");
            }
View Full Code Here

        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

TOP

Related Classes of org.apache.isis.core.runtime.persistence.ObjectPersistenceException

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.