Package org.apache.cayenne.modeler.pref

Examples of org.apache.cayenne.modeler.pref.DBConnectionInfo


        // 1.2 migration fix - update data source adapter names
        Iterator it = dataSources.values().iterator();

        final String _12package = "org.objectstyle.cayenne.";
        while (it.hasNext()) {
            DBConnectionInfo info = (DBConnectionInfo) it.next();
            if (info.getDbAdapter() != null && info.getDbAdapter().startsWith(_12package)) {
                info.setDbAdapter("org.apache.cayenne."
                        + info.getDbAdapter().substring(_12package.length()));

               // info.getObjectContext().commitChanges();
            }
        }
View Full Code Here


        super(parent);

        this.dataMap = dataMap;
        this.tables = new TableSelectorController(parent);
        this.view = new DBGeneratorOptionsView(tables.getView());
        this.connectionInfo = new DBConnectionInfo();
        this.generatorDefaults = new DBGeneratorDefaults(parent
                .getPreferenceForProject()
                .node("DbGenerator"));

        this.view.setTitle(title);
View Full Code Here

                        getProjectController().getPreferenceForDataDomain().node(
                                "DataNode").node(node.getName()));

        String key = (nodeDefaults != null) ? nodeDefaults.getLocalDataSource() : null;
        if (key != null) {
            DBConnectionInfo info = (DBConnectionInfo) getApplication()
                    .getCayenneProjectPreferences()
                    .getDetailObject(DBConnectionInfo.class)
                    .getObject(key);

            if (info != null) {
                return info;
            }
        }

        // extract data from the node
        if (!XMLPoolingDataSourceFactory.class.getName().equals(
                node.getDataSourceFactoryType())) {
            return null;
        }

        // create transient object..
        DBConnectionInfo nodeInfo = new DBConnectionInfo();

        nodeInfo.copyFrom(node.getDataSourceDescriptor());

        nodeInfo.setDbAdapter(node.getAdapterType());

        return nodeInfo;
    }
View Full Code Here

    protected DBConnectionInfo createDataSource() {
        if (canceled) {
            return null;
        }

        DBConnectionInfo prototype = (DBConnectionInfo) dataSources.get(prototypeKey);
        DBConnectionInfo dataSource = (DBConnectionInfo) getApplication()
                .getCayenneProjectPreferences()
                .getDetailObject(DBConnectionInfo.class)
                .create(getName());

        prototype.copyTo(dataSource);
View Full Code Here

    protected DBConnectionInfo createDataSource() {
        if (canceled) {
            return null;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) getApplication()
                .getCayenneProjectPreferences()
                .getDetailObject(DBConnectionInfo.class)
                .create(getName());

        Object adapter = view.getAdapters().getSelectedItem();
        if (NO_ADAPTER.equals(adapter)) {
            adapter = null;
        }

        if (adapter != null) {
            String adapterString = adapter.toString();
            dataSource.setDbAdapter(adapterString);

            // guess adapter defaults...
            AdapterMapping defaultMap = getApplication().getAdapterMapping();
            dataSource.setJdbcDriver(defaultMap.jdbcDriverForAdapter(adapterString));
            dataSource.setUrl(defaultMap.jdbcURLForAdapter(adapterString));
        }

        return dataSource;
    }
View Full Code Here

    public CayenneProjectPreferences() {
        cayennePreferences = new HashMap<Class<?>, ChildrenMapPreference>();

        cayennePreferences.put(DBConnectionInfo.class, new ChildrenMapPreference(
                new DBConnectionInfo()));

        projectCayennePreferences = new HashMap<Preferences, CayennePreference>();

        for (ChildrenMapPreference value : cayennePreferences.values()) {
            value.initChildrenPreferences();
View Full Code Here

        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
            return;
        }

        DBConnectionInfo dataSource = (DBConnectionInfo) getApplication()
            .getCayenneProjectPreferences()
            .getDetailObject(DBConnectionInfo.class)
            .getObject(key);

        if (dataSource != null) {
            if (dataSource.copyTo(projectDSI)) {
                refreshView();
                super.nodeChangeProcessor.modelUpdated(null, null, null);
                mainController.updateStatus(null);
            }
            else {
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.pref.DBConnectionInfo

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.