Package org.objectstyle.wolips.eomodeler.core.sql

Examples of org.objectstyle.wolips.eomodeler.core.sql.IEOSQLReverseEngineer


      if (model == null) {
        MessageDialog.openError(getWindow().getShell(), "Select a Model", "Select a model to reverse engineer into.");
      } else {
        EODatabaseConfig activeDatabaseConfig = model.getActiveDatabaseConfig();
        ClassLoader eomodelClassLoader = IEOClassLoaderFactory.Utility.createClassLoader(model);
        IEOSQLReverseEngineer reverseEngineer = IEOSQLReverseEngineerFactory.Utility.reverseEngineerFactory().reverseEngineer(activeDatabaseConfig, eomodelClassLoader);
        List<String> tableNames = reverseEngineer.reverseEngineerTableNames();

        ListSelectionDialog dlg = new ListSelectionDialog(getWindow().getShell(), tableNames, new StringContentProvider(), new StringLabelProvider(), "Select the tables to reverse engineer:");
        dlg.setInitialSelections(tableNames.toArray());
        dlg.setTitle("Reverse Engineer");
        if (dlg.open() == Window.OK) {
          Object[] selectedTableNameObjs = dlg.getResult();
          String[] selectedTableNames = new String[selectedTableNameObjs.length];
          System.arraycopy(selectedTableNameObjs, 0, selectedTableNames, 0, selectedTableNameObjs.length);
          List<String> selectedTableNamesList = Arrays.asList(selectedTableNames);
          File reverseEngineeredEOModelFolder = reverseEngineer.reverseEngineerWithTableNamesIntoModel(selectedTableNamesList);
          Set<EOModelVerificationFailure> failures = new HashSet<EOModelVerificationFailure>();
          model.importEntitiesFromModel(reverseEngineeredEOModelFolder.toURL(), failures);
          if (failures.size() > 0) {
            EOModelErrorDialog dialog = new EOModelErrorDialog(getWindow().getShell(), failures);
            dialog.open();
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.core.sql.IEOSQLReverseEngineer

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.