Examples of ITableInfo


Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

    }

    public void testGetForeignKeySQL() throws Exception {
        // Test for NPE in DBUtil.getForeignKeySQL when the TableInfo
        // returns null for getImportedKeys
        ITableInfo ti = createNiceMock(ITableInfo.class);
        DBUtil.getForeignKeySQL(null, ti, null);
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

        pbMain.setValue(0);
        pbMain.setMaximum(tableInfoArray.length);

        for (int i = 0; i < tableInfoArray.length; i++)
        {
          ITableInfo tableInfo = tableInfoArray[i];
          pbMain.setString(tableInfo.getSimpleName() + " " + (i + 1) + "/" + pbMain.getMaximum());

          checkColumns(tableInfo, oldValue);

          pbMain.setValue(i + 1);
          pbMain.repaint();
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

        lblFooterTableResult.setText("");
        pbMain.setValue(0);
        pbMain.setMaximum(tableInfoArray.length);
     
        for (int i = 0; i < tableInfoArray.length; i++) {
          ITableInfo tableInfo = tableInfoArray[i];
          pbMain.setString(tableInfo.getSimpleName() + " " + (i + 1)
              + "/" + pbMain.getMaximum());

          checkColumns(tableInfo);

          pbMain.setValue(i + 1);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

          log.debug("CopyTableCommand.execute: schema=" + schema);
        }
        dbObjs = DBUtil.getTables(_session, catalog, schema, null);
        for (int i = 0; i < dbObjs.length; i++)
        {
          ITableInfo info = (ITableInfo) dbObjs[i];
          if (log.isDebugEnabled())
          {
            log.debug("dbObj[" + i + "] = " + info.getSimpleName());
          }
        }
      }

      _plugin.setCopySourceSession(_session);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

            TableDiffExecutor diff = new TableDiffExecutor(sourceMetaData,
                                                           destMetaData);
            for (String table : tableNames) {
                if (tableMap1.containsKey(table)) {
                    if (tableMap2.containsKey(table)) {
                        ITableInfo t1 = tableMap1.get(table);
                        ITableInfo t2 = tableMap2.get(table);
                        diff.setTableInfos(t1, t2);
                        diff.execute();
                        List<ColumnDifference> columnDiffs =
                            diff.getColumnDifferences();
                        if (columnDiffs != null && columnDiffs.size() > 0) {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

            for (int i = 0; i < dbObjs.length; i++) {
                if (false == dbObjs[i] instanceof ITableInfo) {
                    continue;
                }         
                try {
                    ITableInfo ti = (ITableInfo) dbObjs[i];
                    result[i] =
                        DBUtil.getTableCount(sourceSession,
                                             ti.getCatalogName(),
                                             ti.getSchemaName(),
                                             ti.getSimpleName(),
                                             DialectFactory.SOURCE_TYPE);
                } catch (Exception e) {
                    s_log.error(
                        "Unexpected exception while attempting to get table counts",e);
                    result[i] = 0;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

  @Before
  public void setUp() throws Exception
  {
    classUnderTest = new TableSourceTab(HINT, STMT_SEP, true);
    ITableInfo mockTableInfo = mockHelper.createMock(ITableInfo.class);
    super.mockDatabaseObjectInfo = mockTableInfo;
     expect(mockDatabaseObjectInfo.getDatabaseObjectType()).andStubReturn(DatabaseObjectType.TABLE);
     expect(mockTableInfo.getType()).andStubReturn("MATERIALIZED");
    
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

  {
    OraclePreferenceBean prefs = mockHelper.createMock(OraclePreferenceBean.class);
    classUnderTest = new OracleTableParentExpander(prefs);

    expect(prefs.isExcludeRecycleBinTables()).andStubReturn(true);
    ITableInfo mockTableInfo = mockHelper.createMock(ITableInfo.class);
    expect(mockTableInfo.getSimpleName()).andReturn(TEST_SIMPLE_NAME);
    String[] tableTypes = new String[] { TEST_SIMPLE_NAME };
    ITableInfo[] tables = new ITableInfo[] { mockTableInfo };
    expect(
      mockSchemaInfo.getITableInfos(eq(TEST_CATALOG_NAME), eq(TEST_SCHEMA_NAME),
        isA(ObjFilterMatcher.class), aryEq(tableTypes))).andStubReturn(tables);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

  @Before
  public void setUp() throws Exception
  {
    classUnderTest = new SnapshotSourceTab();
    ITableInfo mockTableInfo = mockHelper.createMock(ITableInfo.class);
    expect(mockTableInfo.getDatabaseObjectType()).andStubReturn(DatabaseObjectType.VIEW);
    mockDatabaseObjectInfo = mockTableInfo;
    PrimaryKeyInfo[] primaryKeyInfos = new PrimaryKeyInfo[0];
    expect(mockMetaData.getPrimaryKey(mockTableInfo)).andStubReturn(primaryKeyInfos);
    IQueryTokenizer mockTokenizer = mockHelper.createMock(IQueryTokenizer.class);
    expect(mockTokenizer.getSQLStatementSeparator()).andStubReturn(";");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.ITableInfo

      s_log.error("onExecute: _info[0] isn't an instance of ITableInfo: class="
        + _info[0].getClass().getName());
      return;
    }

    ITableInfo ti = (ITableInfo) _info[0];
    TableColumnInfo[] columns = _session.getSQLConnection().getSQLMetaData().getColumnInfo(ti);

    // If there is only one column in the table,
    if (columns.length == 1)
    {
      if (s_log.isDebugEnabled()) {
        s_log.debug("Table has exactly one column, so presenting the modify column dialog");
      }
      columnToModify = columns[0];
      showCustomDialog();
    } else
    {
      if (s_log.isDebugEnabled()) {
        s_log.debug("Table has exactly " + columns.length
          + " columns, so presenting the column list selection dialog");
      }
      listDialog = new ColumnListDialog(columns, ColumnListDialog.MODIFY_COLUMN_MODE);
      listDialog.setTableName(ti.getQualifiedName());
      listDialog.setSingleSelection();
      listDialog.addColumnSelectionListener(new ColumnListSelectionActionListener());
      listDialog.setLocationRelativeTo(_session.getApplication().getMainFrame());
      listDialog.setVisible(true);
    }
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.