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

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.NotPersistableException


     * As per {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)}, ensures
     * object can be persisted else throws {@link NotPersistableException}.
     */
    protected void assertObjectNotPersistentAndPersistable(final ObjectAdapter object) {
        if (alreadyPersistedOrNotPersistable(object)) {
            throw new NotPersistableException("can't make object persistent - either already persistent, " + "or transient only: " + object);
        }
    }
View Full Code Here


     * @see #remapAsPersistent(ObjectAdapter)
     */
    @Override
    public void makePersistent(final ObjectAdapter adapter) {
        if (adapter.isPersistent()) {
            throw new NotPersistableException("Object already persistent: " + adapter);
        }
        if (!adapter.getSpecification().persistability().isPersistable()) {
            throw new NotPersistableException("Object is not persistable: " + adapter);
        }
        final ObjectSpecification specification = adapter.getSpecification();
        if (specification.isService()) {
            throw new NotPersistableException("Cannot persist services: " + adapter);
        }

        makePersistentInPersistenceLayer(adapter);
    }
View Full Code Here

     * As per {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)}, ensures object can be persisted else throws
     * {@link NotPersistableException}.
     */
    protected void assertObjectNotPersistentAndPersistable(final ObjectAdapter object) {
        if (alreadyPersistedOrNotPersistable(object)) {
            throw new NotPersistableException("can't make object persistent - either already persistent, "
                + "or transient only: " + object);
        }
    }
View Full Code Here

     * @see #remapAsPersistent(ObjectAdapter)
     */
    @Override
    public void makePersistent(final ObjectAdapter adapter) {
        if (adapter.isPersistent()) {
            throw new NotPersistableException("Object already persistent: " + adapter);
        }
        if (!adapter.getSpecification().persistability().isPersistable()) {
            throw new NotPersistableException("Object is not persistable: " + adapter);
        }
        final ObjectSpecification specification = adapter.getSpecification();
        if (specification.isService()) {
            throw new NotPersistableException("Cannot persist services: " + adapter);
        }

        makePersistentInPersistenceLayer(adapter);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.NotPersistableException

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.