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

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


        epv.setName("changed");

        iswf.bounceSystem();

        // then found
        List<ObjectAdapter> retrievedInstance = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, adapter.titleString()));
        assertEquals(1, retrievedInstance.size());
       
        final ObjectAdapter retrievedAdapter = retrievedInstance.get(0);
        assertNotSame(adapter, retrievedAdapter);
        assertEquals(((SimpleEntity)adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
View Full Code Here


        iswf.persist(epv2);

        iswf.bounceSystem();
       
        // when search for object
        List<ObjectAdapter> retrievedInstance = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, epv2Adapter.titleString()));
       
        // then find
        assertEquals(1, retrievedInstance.size());
        final ObjectAdapter retrievedAdapter = retrievedInstance.get(0);

        assertNotSame(epv2Adapter, retrievedAdapter);
        assertEquals(((SimpleEntity)epv2Adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
        assertEquals(epv2Adapter.getOid(), retrievedAdapter.getOid());

        // and when search for some other title
        retrievedInstance = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, "some other title"));
       
        // then don't find
        assertEquals(0, retrievedInstance.size());
    }
View Full Code Here

        epv.setName("changed");

        iswf.bounceSystem();

        // then found
        List<ObjectAdapter> retrievedInstance = getStore().loadInstancesAndAdapt(new PersistenceQueryFindByTitle(epvSpecification, adapter.titleString()));
        assertEquals(1, retrievedInstance.size());
       
        final ObjectAdapter retrievedAdapter = retrievedInstance.get(0);
        assertNotSame(adapter, retrievedAdapter);
        assertEquals(((SimpleEntity)adapter.getObject()).getName(), ((SimpleEntity)retrievedAdapter.getObject()).getName());
View Full Code Here

            return new PersistenceQueryFindAllInstances(noSpec, queryFindAllInstances.getStart(), queryFindAllInstances.getCount());
        }
        if (query instanceof QueryFindByTitle) {
            final QueryFindByTitle<?> queryByTitle = (QueryFindByTitle<?>) query;
            final String title = queryByTitle.getTitle();
            return new PersistenceQueryFindByTitle(noSpec, title, queryByTitle.getStart(), queryByTitle.getCount());
        }
        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.core.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.