Package org.apache.cayenne.remote

Examples of org.apache.cayenne.remote.ClientChannel


    public void testPrefetchingToOne() throws Exception {
        createTestData("testPrefetching");

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        ObjectId prefetchedId = new ObjectId(
                "MtTable1",
                MtTable1.TABLE1_ID_PK_COLUMN,
View Full Code Here


    public void testPrefetchingToOneNull() throws Exception {
        createTestData("testPrefetchingToOneNull");

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        SelectQuery q = new SelectQuery(ClientMtTable2.class);
        q.addPrefetch(ClientMtTable2.TABLE1_PROPERTY);
View Full Code Here

    public void testPrefetchingToMany() throws Exception {
        createTestData("testPrefetching");

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        SelectQuery q = new SelectQuery(ClientMtTable1.class);
        q.addOrdering(ClientMtTable1.GLOBAL_ATTRIBUTE1_PROPERTY, true);
        q.addPrefetch(ClientMtTable1.TABLE2ARRAY_PROPERTY);
View Full Code Here

        deleteTestData();
        createTestData("testPerformPaginatedQuery");

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        SelectQuery query = new SelectQuery(ClientMtTable1.class);
        query.setPageSize(5);
        List objects = context.performQuery(query);
View Full Code Here

    public void testPrefetchingToManyEmpty() throws Exception {
        createTestData("testPrefetching");

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()), LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        SelectQuery q = new SelectQuery(ClientMtTable1.class);
        q.addOrdering(ClientMtTable1.GLOBAL_ATTRIBUTE1_PROPERTY, true);
        q.addPrefetch(ClientMtTable1.TABLE2ARRAY_PROPERTY);
View Full Code Here

        deleteTestData();

        UnitLocalConnection connection = new UnitLocalConnection(new ClientServerChannel(
                getDomain()));
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        ClientMtTable1 o = context.newObject(ClientMtTable1.class);
        o.setGlobalAttribute1("aaa");
View Full Code Here

    private CayenneContext createClientContext() {
        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel clientChannel = new ClientChannel(connection);
        return new CayenneContext(clientChannel);
    }
View Full Code Here

        assertNotNull(channel);
        assertTrue(channel instanceof ClientChannel);
        assertSame("DataChannel must be a singleton", channel, injector
                .getInstance(DataChannel.class));

        ClientChannel clientChannel = (ClientChannel) channel;
        assertTrue(clientChannel.getConnection() instanceof MockClientConnection);
        assertTrue(clientChannel.getEventManager() instanceof DefaultEventManager);
        assertFalse(clientChannel.isChannelEventsEnabled());
    }
View Full Code Here

        };

        Injector injector = DIBootstrap.createInjector(module);

        DataChannel channel = injector.getInstance(DataChannel.class);
        ClientChannel clientChannel = (ClientChannel) channel;
        assertTrue(clientChannel.isChannelEventsEnabled());
    }
View Full Code Here

        boolean channelEvents = properties.getBoolean(
                Constants.ROP_CHANNEL_EVENTS_PROPERTY,
                false);

        return new ClientChannel(connection, channelEvents, eventManager, channelEvents);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.remote.ClientChannel

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.