Examples of PersistenceQueryBuiltIn


Examples of org.apache.isis.core.runtime.persistence.query.PersistenceQueryBuiltIn

    public List<ObjectAdapter> loadInstancesAndAdapt(final PersistenceQuery persistenceQuery) throws ObjectPersistenceException, UnsupportedFindException {

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the in-memory object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final List<ObjectAdapter> instances = Lists.newArrayList();
        final ObjectSpecification spec = persistenceQuery.getSpecification();
        findInstances(spec, builtIn, instances);
        return resolved(instances);
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.query.PersistenceQueryBuiltIn

    public List<ObjectAdapter> loadInstancesAndAdapt(final PersistenceQuery persistenceQuery) {

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the XML object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final ObjectSpecification objSpec = builtIn.getSpecification();
        LOG.debug("getInstances of " + objSpec + " where " + builtIn);
        final RootOid oid = RootOidDefault.create(objSpec.getSpecId(), "dummy");
        final ObjectData patternData = new ObjectData(oid, null);
        return getInstances(patternData, builtIn);
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.query.PersistenceQueryBuiltIn

    public List<ObjectAdapter> loadInstancesAndAdapt(final PersistenceQuery persistenceQuery) throws ObjectPersistenceException, UnsupportedFindException {

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the in-memory object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final List<ObjectAdapter> instances = Lists.newArrayList();
        final ObjectSpecification spec = persistenceQuery.getSpecification();
        findInstances(spec, builtIn, instances);
        return resolved(instances);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

    public ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) throws ObjectPersistenceException, UnsupportedFindException {

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the in-memory object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final Vector<ObjectAdapter> instances = new Vector<ObjectAdapter>();
        final ObjectSpecification spec = persistenceQuery.getSpecification();
        findInstances(spec, builtIn, instances);
        return toInstancesArray(instances);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

    public ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery) {

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the XML object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        LOG.debug("getInstances of " + builtIn.getSpecification() + " where " + builtIn);
        final ObjectData patternData = new ObjectData(builtIn.getSpecification(), null, null);
        final ObjectAdapter[] instances = getInstances(patternData, builtIn);
        return instances;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

     * TODO: this code is not currently in use because there is no way to set up
     * the cache. We may want to change what the cache is keyed on.
     */
    private ObjectAdapter[] getInstancesFromCache(final PersistenceQuery persistenceQuery) {
        final ObjectSpecification noSpec = persistenceQuery.getSpecification();
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;
        final ObjectAdapter collection = cache.get(noSpec);
        if (!collection.getSpecification().isCollection()) {
            return new ObjectAdapter[0];
        }

        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
        final List<ObjectAdapter> instances = new ArrayList<ObjectAdapter>();
        for (final ObjectAdapter instance : facet.iterable(collection)) {
            if (builtIn.matches(instance)) {
                instances.add(instance);
            }
        }
        return instances.toArray(new ObjectAdapter[instances.size()]);
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format(
                "Provided PersistenceQuery not supported; was {0}; " + "the XML object store only supports {1}",
                persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        LOG.debug("getInstances of " + builtIn.getSpecification() + " where " + builtIn);
        final ObjectData patternData = new ObjectData(builtIn.getSpecification(), null, null);
        final ObjectAdapter[] instances = getInstances(patternData, builtIn);
        return instances;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

        if (!(persistenceQuery instanceof PersistenceQueryBuiltIn)) {
            throw new IllegalArgumentException(MessageFormat.format(
                "Provided PersistenceQuery not supported; was {0}; " + "the in-memory object store only supports {1}",
                persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final Vector<ObjectAdapter> instances = new Vector<ObjectAdapter>();
        final ObjectSpecification spec = persistenceQuery.getSpecification();
        findInstances(spec, builtIn, instances);
        return toInstancesArray(instances);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryBuiltIn

     * TODO: this code is not currently in use because there is no way to set up the cache. We may want to change what
     * the cache is keyed on.
     */
    private ObjectAdapter[] getInstancesFromCache(final PersistenceQuery persistenceQuery) {
        final ObjectSpecification noSpec = persistenceQuery.getSpecification();
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;
        final ObjectAdapter collection = cache.get(noSpec);
        if (!collection.getSpecification().isCollection()) {
            return new ObjectAdapter[0];
        }

        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
        final List<ObjectAdapter> instances = new ArrayList<ObjectAdapter>();
        for (final ObjectAdapter instance : facet.iterable(collection)) {
            if (builtIn.matches(instance)) {
                instances.add(instance);
            }
        }
        return instances.toArray(new ObjectAdapter[instances.size()]);
    }
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.