Package org.apache.cayenne

Examples of org.apache.cayenne.DataChannel


        if (name == null) {
            throw new IllegalArgumentException("Name is null for shared session.");
        }

        HttpSession httpSession = getSession(true);
        DataChannel channel;

        synchronized (sharedChannels) {
            channel = getSharedChannel(name);
            if (channel == null) {
                channel = createChannel();
View Full Code Here


        dbHelper.deleteAll("ARTIST");
    }

    public void testCommitDecorated() {
        DataDomain dd = runtime.getDataDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = (DataContext) runtime.newContext(decorator);

        Artist a = context.newObject(Artist.class);
        a.setArtistName("XXX");
        context.commitChanges();
View Full Code Here

        assertEquals(new Integer(1), count.get("x"));
    }

    public void testGetParentDataDomain() {
        DataDomain dd = runtime.getDataDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = (DataContext) runtime.newContext(decorator);

        assertSame(dd, context.getParentDataDomain());
    }
View Full Code Here

        assertTrue(configured[0]);
        assertTrue(configured[1]);
    }

    public void testGetDataChannel_CustomModule() {
        final DataChannel channel = new DataChannel() {

            public EntityResolver getEntityResolver() {
                return null;
            }
View Full Code Here

    @Inject
    protected DbAdapter adapter;

    public DBHelper get() throws ConfigurationException {
        DataChannel channel = serverRuntimeProvider.get().getChannel();
        DataMap firstMap = channel.getEntityResolver().getDataMaps().iterator().next();
        return new FlavoredDBHelper(dataSourceFactory.getSharedDataSource(), adapter.getQuotingStrategy(), firstMap);
    }
View Full Code Here

            }
        };

        ClientRuntime runtime = new ClientRuntime(properties, extraModule);

        DataChannel channel = runtime.getChannel();
        assertNotNull(channel);
        assertTrue(channel instanceof ClientChannel);
    }
View Full Code Here

        // create and initialize provide instance to test
        DataDomainProvider provider = new DataDomainProvider();
        injector.injectMembers(provider);

        DataChannel channel = provider.get();
        assertNotNull(channel);

        assertTrue(channel instanceof DataDomain);

        DataDomain domain = (DataDomain) channel;
View Full Code Here

    ClientConnection connection = new HessianConnection(
        "http://localhost:8080/cayenne-service", "cayenne-user",
        "secret", null);

    DataChannel channel = new ClientChannel(connection);

    ObjectContext context = new CayenneContext(channel);

    // cleans up all data, so that we start with empty database on each
    // tutorial run
View Full Code Here

        // create and initialize provide instance to test
        DataDomainProvider provider = new DataDomainProvider();
        injector.injectMembers(provider);

        DataChannel channel = provider.get();
        assertNotNull(channel);

        assertTrue(channel instanceof DataDomain);

        DataDomain domain = (DataDomain) channel;
View Full Code Here

        deleteTestData();
    }

    public void testCommitDecorated() {
        DataDomain dd = getDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = new DataContext(decorator, new ObjectStore(dd
                .getSharedSnapshotCache()));

        Artist a = context.newObject(Artist.class);
        a.setArtistName("XXX");
View Full Code Here

TOP

Related Classes of org.apache.cayenne.DataChannel

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.