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

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


    public void testGetInstancesByTitle() throws Exception {
        addObjectToStoreAndDiscardAdapters();

        final ObjectSpecification specification = originalAdapter.getSpecification();
        final ObjectAdapter[] retrievedInstance =
            store.getInstances(new PersistenceQueryFindByTitle(specification, "le STR"));
        assertEquals(1, retrievedInstance.length);
        assertNotSame(originalAdapter, retrievedInstance[0]);
        assertSame(originalAdapter.getObject(), retrievedInstance[0].getObject());
    }
View Full Code Here


    public void testSaveInstance() throws Exception {

        final ObjectSpecification specification = object.getSpecification();
        ObjectAdapter[] retrievedInstance =
            store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
        assertEquals(0, retrievedInstance.length);

        ((TestProxyAdapter) object).setupTitleString("changed title");
        final PersistenceCommand command = store.createSaveObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));

        resetIdentityMap();

        retrievedInstance = store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
        assertEquals(1, retrievedInstance.length);
        assertNotSame(object, retrievedInstance[0]);
    }
View Full Code Here

            return new PersistenceQueryFindAllInstances(noSpec);
        }
        if (query instanceof QueryFindByTitle) {
            final QueryFindByTitle<?> queryByTitle = (QueryFindByTitle<?>) query;
            final String title = queryByTitle.getTitle();
            return new PersistenceQueryFindByTitle(noSpec, title);
        }
        if (query instanceof QueryFindByPattern) {
            final QueryFindByPattern<?> queryByPattern = (QueryFindByPattern<?>) query;
            final Object pattern = queryByPattern.getPattern();
            final ObjectAdapter patternAdapter = getAdapterManager().adapterFor(pattern);
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindByTitle

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.