Package org.apache.cayenne.configuration.server

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


public class Main {

  public static void main(String[] args) {

    // starting Cayenne
    ServerRuntime cayenneRuntime = new ServerRuntime(
        "cayenne-project.xml");

    // getting a hold of ObjectContext
    ObjectContext context = cayenneRuntime.getContext();

    newObjectsTutorial(context);
    selectTutorial(context);
    deleteTutorial(context);
  }
View Full Code Here


    private TableHelper e1Helper;
    private TableHelper e2Helper;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
        dbHelper = new DBHelper(runtime.getDataSource("lifecycle-db"));
        e1Helper = new TableHelper(dbHelper, "E1", "ID");
        e2Helper = new TableHelper(dbHelper, "E2", "ID");
    }
View Full Code Here

    private ServerRuntime runtime;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
    }
View Full Code Here

    private TableHelper auditableChild3;
    private TableHelper auditableChildUuid;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");

        DBHelper dbHelper = new DBHelper(runtime.getDataSource(null));

        auditable1 = new TableHelper(dbHelper, "AUDITABLE1").setColumns("ID", "CHAR_PROPERTY1");
View Full Code Here

    private ServerRuntime runtime;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
    }
View Full Code Here

    private ServerRuntime runtime;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");
    }
View Full Code Here

        resolver = mock(EntityResolver.class);

        ObjEntity objectEntity = new ObjEntity("CayenneDataObject");
        when(resolver.lookupObjEntity(any(Object.class))).thenReturn(objectEntity);

        runtime = new ServerRuntime("cayenne-lifecycle.xml");
    }
View Full Code Here

    private TableHelper rootTable;
    private TableHelper e1Table;

    @Override
    protected void setUp() throws Exception {
        runtime = new ServerRuntime("cayenne-lifecycle.xml");

        // a filter is required to invalidate root objects after commit
        ObjectIdRelationshipFilter filter = new ObjectIdRelationshipFilter();
        runtime.getDataDomain().addFilter(filter);
        runtime.getDataDomain().getEntityResolver().getCallbackRegistry().addListener(
View Full Code Here

                binder.bind(ResourceLocator.class).toInstance(
                        new FilesystemResourceLocator(projectFile));
            }
        };

        ServerRuntime runtime = new ServerRuntime(projectFileLocation,
                dataPortModule);
        DataDomain domain;

        ClassLoader threadContextClassLoader = Thread.currentThread()
                .getContextClassLoader();
        try {
            // need to set context class loader so that cayenne can find jdbc
            // driver and
            // PasswordEncoder
            // TODO: andrus 04/11/2010 is this still relevant in 3.1?
            Thread.currentThread().setContextClassLoader(
                    getClass().getClassLoader());

            domain = runtime.getDataDomain();
        } catch (Exception ex) {
            throw new BuildException(
                    "Error loading Cayenne configuration from " + projectFile,
                    ex);
        } finally {
View Full Code Here

        if (configurationLocation == null) {
            throw new NullPointerException("Null 'configurationLocation', "
                    + "annotate your test case with @UseServerRuntime");
        }

        return new ServerRuntime(configurationLocation, new ServerExtraModule());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.configuration.server.ServerRuntime

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.