Package org.apache.isis.runtimes.dflt.runtime.transaction

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


    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

                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

                    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

            }

            @Override
            public void execute() {
                if (adapter.getVersion() == null) {
                    throw new ObjectPersistenceException("Object to be deleted does not have a version (maybe it should be resolved first): " + adapter);
                }
                final DestroyObjectCommand command = objectStore.createDestroyObjectCommand(adapter);
                getTransactionManager().addCommand(command);
            }
View Full Code Here

            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");
            }
View Full Code Here

    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

                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);
View Full Code Here

                    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);
View Full Code Here

            }

            @Override
            public void execute() {
                if (adapter.getVersion() == null) {
                    throw new ObjectPersistenceException(
                        "Object to be deleted does not have a version (maybe it should be resolved first): " + adapter);
                }
                final DestroyObjectCommand command = objectStore.createDestroyObjectCommand(adapter);
                getTransactionManager().addCommand(command);
            }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.transaction.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.