Examples of DbAdapterFactory


Examples of org.apache.cayenne.configuration.server.DbAdapterFactory

    public void testDbApdater() throws Exception {
        Log log = mock(Log.class);
        Injector i = DIBootstrap.createInjector(new ToolsModule(log));

        DbAdapterFactory factory = i.getInstance(DbAdapterFactory.class);

        DataNodeDescriptor nodeDescriptor = mock(DataNodeDescriptor.class);
        DataSource dataSource = mock(DataSource.class);

        assertTrue(factory.createAdapter(nodeDescriptor, dataSource) instanceof AutoAdapter);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.server.DbAdapterFactory

    }

    protected DbAdapter getAdapter(Injector injector, DataSource dataSource)
            throws Exception {

        DbAdapterFactory adapterFactory = injector
                .getInstance(DbAdapterFactory.class);

        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setAdapterType(adapter);

        return adapterFactory.createAdapter(nodeDescriptor, dataSource);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.