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

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


        }
        final ObjectSpecification objectSpec = getSpecificationLookup().lookupBySpecId(oid.getObjectSpecId());
        final ObjectStoreInstances ins = instancesFor(objectSpec.getSpecId());
        final ObjectAdapter adapter = ins.getObjectAndMapIfRequired(oid);
        if (adapter == null) {
            throw new ObjectNotFoundException(oid);
        }
        return adapter;
    }
View Full Code Here


            // else recreate
            try {
                final Object pojo = pojoRecreator.recreatePojo(typedOid);
                adapter = mapRecreatedPojo(typedOid, pojo);
            } catch(RuntimeException ex) {
                throw new ObjectNotFoundException(typedOid, ex);
            }
        }

        // sync versions of original, with concurrency checking if required
        Oid adapterOid = adapter.getOid();
View Full Code Here

                if(exceptionRecognizer instanceof ExceptionRecognizer2) {
                    final ExceptionRecognizer2 recognizer = (ExceptionRecognizer2) exceptionRecognizer;
                    final ExceptionRecognizer2.Recognition recognition = recognizer.recognize2(e);
                    if(recognition != null) {
                        if(recognition.getCategory() == ExceptionRecognizer2.Category.NOT_FOUND) {
                            throw new ObjectNotFoundException(oid);
                        }
                    }
                }
            }

            throw e;
        }

        if (result == null) {
            throw new ObjectNotFoundException(oid);
        }
        return result;
    }
View Full Code Here

        final Results rs = connector.select(completeSelectStatement(sql, 0, 0));
        final ObjectSpecification objectSpec = getSpecificationLoader().lookupBySpecId(typedOid.getObjectSpecId());
        if (rs.next()) {
            return loadMappedObject(connector, objectSpec, rs);
        } else {
            throw new ObjectNotFoundException("No object with with " + typedOid + " in table " + table);
        }
    }
View Full Code Here

        if (data instanceof ObjectData) {
            object = recreateAdapter((ObjectData) data);
        } else if (data instanceof CollectionData) {
            throw new IsisException();
        } else {
            throw new ObjectNotFoundException(oid);
        }
        return object;
    }
View Full Code Here

    public MongoStateReader(final DB db, final ObjectSpecId objectSpecId, final String mongoId) {
        final DBCollection instances = db.getCollection(objectSpecId.asString());
        instance = instances.findOne(mongoId);
        if (instance == null) {
            throw new ObjectNotFoundException(mongoId);
        }
        if(LOG.isDebugEnabled()) {
            LOG.debug("loading " + instance);
        }
    }
View Full Code Here

        if (status.equals("error")) {
            final String message = getResponseData();
            throw new RemotingException(message);
        } else if (status.equals("not-found")) {
            final String message = getResponseData();
            throw new ObjectNotFoundException(message);
        } else if (status.equals("concurrency")) {
            final String data = getResponseData();
            // TODO create better exceptions (requires way to restore
            // object/version)
            if (data.startsWith("{")) {
View Full Code Here

        } catch (final RuntimeException e) {
            throw e;
        }

        if (result == null) {
            throw new ObjectNotFoundException(oid);
        }
        return result;
    }
View Full Code Here

    public void refreshRoot(final ObjectAdapter adapter) {
       
        final Object domainObject = adapter.getObject();
    if (domainObject == null) {
        // REVIEW: is this possible?
            throw new ObjectNotFoundException(adapter.getOid());
        }

        try {
            getPersistenceManager().refresh(domainObject);
        } catch (final RuntimeException e) {
            throw new ObjectNotFoundException(adapter.getOid(), e);
        }

        // possibly redundant because also called in the post-load event
        // listener, but (with JPA impl) found it was required if we were ever to
        // get an eager left-outer-join as the result of a refresh (sounds possible).
View Full Code Here

        } catch (final RuntimeException e) {
            throw e;
        }

        if (result == null) {
            throw new ObjectNotFoundException(oid);
        }
        return result;
    }
View Full Code Here

TOP

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

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.