Package org.apache.isis.applib.query

Examples of org.apache.isis.applib.query.QueryFindAllInstances


    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public Object[] getChoices(ObjectAdapter adapter) {
        final Query query = new QueryFindAllInstances(getObjectSpecification().getFullIdentifier());
        final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
        final List<ObjectAdapter> adapters = Lists.newArrayList(allInstancesAdapter.iterator());
        final List<Object> pojos = Lists.transform(adapters, ObjectAdapter.Functions.getObject());
        return Lists.newArrayList(pojos).toArray();
    }
View Full Code Here


    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public Object[] getChoices(ObjectAdapter adapter) {
        final Query query = new QueryFindAllInstances(getObjectSpecification().getFullIdentifier());
        final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
        final List<ObjectAdapter> adapters = Lists.newArrayList(allInstancesAdapter.iterator());
        final List<Object> pojos = Lists.transform(adapters, ObjectAdapter.Functions.getObject());
        return Lists.newArrayList(pojos).toArray();
    }
View Full Code Here

        @Override
        public void execute(final Workspace workspace, final View view, final Location at) {
            final ObjectAdapter object = view.getContent().getAdapter();
            final ObjectSpecification spec = object.getSpecification();
            final ObjectAdapter instances = IsisContext.getPersistenceSession().findInstances(new QueryFindAllInstances(spec.getFullIdentifier()), QueryCardinality.MULTIPLE);
            workspace.objectActionResult(instances, new Placement(view));
        }
View Full Code Here

        @Override
        public void execute(final Workspace workspace, final View view, final Location at) {
            final ObjectAdapter object = view.getContent().getAdapter();
            final ObjectSpecification spec = object.getSpecification();
            final ObjectAdapter instances = IsisContext.getPersistenceSession().findInstances(new QueryFindAllInstances(spec.getFullIdentifier()), QueryCardinality.MULTIPLE);
            workspace.objectActionResult(instances, new Placement(view));
        }
View Full Code Here

        @Override
        public void execute(final Workspace workspace, final View view, final Location at) {
            final ObjectAdapter object = view.getContent().getAdapter();
            final ObjectSpecification spec = object.getSpecification();
            final ObjectAdapter instances =
                IsisContext.getPersistenceSession().findInstances(new QueryFindAllInstances(spec.getFullIdentifier()),
                    QueryCardinality.MULTIPLE);
            workspace.objectActionResult(instances, new Placement(view));
        }
View Full Code Here

                parameterChoicesAdapters[i] = new ObjectAdapter[parameterChoicesPojos[i].length];
                for (int j = 0; j < parameterChoicesPojos[i].length; j++) {
                    parameterChoicesAdapters[i][j] = adapterFor(parameterChoicesPojos[i][j]);
                }
            } else if (BoundedFacetUtils.isBoundedSet(paramSpec)) {
                final QueryFindAllInstances query = new QueryFindAllInstances(paramSpec.getFullIdentifier());
                final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
                parameterChoicesAdapters[i] = new ObjectAdapter[allInstancesAdapter.size()];
                int j = 0;
                for (final ObjectAdapter adapter : allInstancesAdapter) {
                    parameterChoicesAdapters[i][j++] = adapter;
View Full Code Here

            for (final Object choice : choices) {
                parameterChoices.add(getAdapterMap().adapterFor(choice));
            }
        }
        if (parameterChoices.size() == 0 && BoundedFacetUtils.isBoundedSet(getSpecification())) {
            final Query query = new QueryFindAllInstances(getSpecification().getFullIdentifier());
            final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
            for (final ObjectAdapter choiceAdapter : allInstancesAdapter) {
                parameterChoices.add(choiceAdapter);
            }
        }
View Full Code Here

                options[i] = getAdapterMap().adapterFor(pojoOptions[i]);
            }
            return options;
        } else if (BoundedFacetUtils.isBoundedSet(getSpecification())) {

            final QueryFindAllInstances query = new QueryFindAllInstances(getSpecification().getFullIdentifier());
            final List<ObjectAdapter> allInstancesAdapter = getQuerySubmitter().allMatchingQuery(query);
            final ObjectAdapter[] options = new ObjectAdapter[allInstancesAdapter.size()];
            int j = 0;
            for (final ObjectAdapter adapter : allInstancesAdapter) {
                options[j++] = adapter;
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.query.QueryFindAllInstances

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.