Examples of PersistFailedException


Examples of org.apache.isis.applib.PersistFailedException

    @Override
    public void persist(final Object domainObject) {
        final ObjectAdapter adapter = getAdapterManager().adapterFor(domainObject);

        if(adapter == null) {
            throw new PersistFailedException("Object not known to framework; instantiate using newTransientInstance(...) rather than simply new'ing up.");
        }
        if (adapter.isParented()) {
            // TODO check aggregation is supported
            return;
        }
        if (isPersistent(domainObject)) {
            throw new PersistFailedException("Object already persistent; OID=" + adapter.getOid());
        }
        getObjectPersistor().makePersistent(adapter);
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

    @Override
    public void persist(final Object domainObject) {
        final ObjectAdapter adapter = getAdapterManager().adapterFor(unwrapped(domainObject));

        if(adapter == null) {
            throw new PersistFailedException("Object not known to framework; instantiate using newTransientInstance(...) rather than simply new'ing up.");
        }
        if (adapter.isParented()) {
            // TODO check aggregation is supported
            return;
        }
        if (isPersistent(domainObject)) {
            throw new PersistFailedException("Object already persistent; OID=" + adapter.getOid());
        }
        getObjectPersistor().makePersistent(adapter);
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

                return ((Money) o).doubleValue();
            } else {
                return ((Money) o).getCurrency();
            }
        } else {
            throw new PersistFailedException("Invalid object type " + o.getClass().getCanonicalName() + " for MoneyValueMapper");
        }
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

        if (correspondingClass == DateTime.class) {
            final java.sql.Timestamp o = (java.sql.Timestamp) results.getObject(columnName);
            final DateTime timeValue = new DateTime(o.getTime());
            restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(timeValue);
        } else {
            throw new PersistFailedException("Unhandled time type: " + correspondingClass.getCanonicalName());
        }
        return restoredValue;
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

                return "Image";
            } else {
                return getOutputStreamFromImage((Image) o);
            }
        } else {
            throw new PersistFailedException("Invalid object type " + o.getClass().getCanonicalName()
                + " for JdbcImageValueMapper");
        }
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

        if (correspondingClass == TimeStamp.class) {
            final java.sql.Timestamp o = (java.sql.Timestamp) results.getObject(columnName);
            final TimeStamp timeValue = new TimeStamp(o.getTime());
            restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(timeValue);
        } else {
            throw new PersistFailedException("Unhandled time type: " + correspondingClass.getCanonicalName());
        }
        return restoredValue;
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

            // 2010-03-05 = 1267747200000
            Date dateValue;
            dateValue = new Date(javaDateValue);
            restoredValue = getAdapterManager().adapterFor(dateValue);
        } else {
            throw new PersistFailedException("Unhandled date type: " + correspondingClass.getCanonicalName());
        }
        return restoredValue;
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

        final Class<?> correspondingClass = field.getSpecification().getCorrespondingClass();
        if (correspondingClass == Time.class) {
            final Time timeValue = results.getTime(columnName);
            restoredValue = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(timeValue);
        } else {
            throw new PersistFailedException("Unhandled time type: " + correspondingClass.getCanonicalName());
        }
        return restoredValue;

    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

        // TODO check aggregation is supported
        if (adapter.isAggregated()) {
            return;
        }
        if (isPersistent(transientObject)) {
            throw new PersistFailedException("Object already persistent: " + adapter);
        }
        getObjectPersistor().makePersistent(adapter);
    }
View Full Code Here

Examples of org.apache.isis.applib.PersistFailedException

            // 2010-03-05 = 1267747200000
            Date dateValue;
            dateValue = new Date(javaDateValue);
            restoredValue = adapterManager.adapterFor(dateValue);
        } else {
            throw new PersistFailedException("Unhandled date type: " + correspondingClass.getCanonicalName());
        }
        return restoredValue;
    }
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.