Package net.sourceforge.squirrel_sql.plugins.dbdiff

Examples of net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference


    public static void main(String[] args) throws Exception {
        ApplicationArguments.initialize(new String[] {});
       
        ISQLDatabaseMetaData md = FwTestUtil.getEasyMockSQLMetaData("oracle", "jdbc:oracle");
        ColumnDifference diff = new ColumnDifference();
        TableColumnInfo column1 = FwTestUtil.getBigintColumnInfo(md, true);
        TableColumnInfo column2 = FwTestUtil.getVarcharColumnInfo(md, true, 100);
        diff.setColumns(column1, column2);
        diff.execute();

        ColumnDifference diff2 = new ColumnDifference();
        TableColumnInfo column3 = FwTestUtil.getVarcharColumnInfo(md, true, 200);
        TableColumnInfo column4 = FwTestUtil.getVarcharColumnInfo(md, true, 100);
        diff2.setColumns(column3, column4);
        diff2.execute();
       
        ColumnDifference diff3 = new ColumnDifference();
        TableColumnInfo column5 =
            FwTestUtil.getTableColumnInfo(md, "LongColumnNameThatIsUnreal", VARCHAR, 100, 0, false);
        diff3.setColumn1(column5);
        diff3.setCol2Exists(false);
       
        final ArrayList<ColumnDifference> diffs = new ArrayList<ColumnDifference>();
        diffs.add(diff);
        diffs.add(diff2);
        diffs.add(diff3);
View Full Code Here


      {
        s_log.error("specified row (" + row + ") equals or exceeds " + "_diffs size(" + _diffs.size()
          + ")");
        return "";
      }
      final ColumnDifference diff = _diffs.get(row);
      if (!diff.isCol1Exists() || !diff.isCol2Exists())
      {
        if (!diff.isCol1Exists() && column % 2 == 0) { return i18n.MISSING_LABEL; }
        if (!diff.isCol2Exists() && column % 2 == 1) { return i18n.MISSING_LABEL; }
      }
      Object result = null;
      switch (column)
      {
      case 0:
        result = JDBCTypeMapper.getJdbcTypeName(diff.getCol1Type());
        break;
      case 1:
        result = JDBCTypeMapper.getJdbcTypeName(diff.getCol2Type());
        break;
      case 2:
        result = diff.getCol1Length();
        break;
      case 3:
        result = diff.getCol2Length();
        break;
      case 4:
        result = diff.col1AllowsNull();
        break;
      case 5:
        result = diff.col2AllowsNull();
        break;
      case 6:
        result = diff.getCol1Remarks();
        break;
      case 7:
        result = diff.getCol2Remarks();
        break;
      default:
        System.err.println("Unknown column: " + column);
      }
      return result;
View Full Code Here

     * @see javax.swing.table.DefaultTableModel#getValueAt(int, int)
     */
    @Override
    public Object getValueAt(int row, int column)
    {
      final ColumnDifference diff = _diffs.get(row);
      if (column == 0) { return diff.getTableName(); }
      if (column == 1) { return diff.getColumnName(); }
      throw new IllegalArgumentException("Invalid column: " + column);
    }
View Full Code Here

      final Component label =
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

      if (_tableDiffs == null) { return label; }
      final ColumnDifference diff = _tableDiffs.get(row);

      if (!diff.isCol1Exists() || !diff.isCol2Exists())
      {
        setMissing(label, value);
        return label;
      }

      switch (column)
      {
      case 0:
      case 1:
        if (!diff.typesEqual())
        {
          setHighlighted(label, value);
        }
        else
        {
          setNormal(label);
        }
        break;
      case 2:
      case 3:
        if (!diff.lengthsEqual())
        {
          setHighlighted(label, value);
        }
        else
        {
          setNormal(label);
        }
        break;
      case 4:
      case 5:
        if (!diff.nullableEqual())
        {
          setHighlighted(label, value);
        }
        else
        {
          setNormal(label);
        }
        break;
      case 6:
      case 7:
        if (!diff.remarksEqual())
        {
          setHighlighted(label, value);
        }
        else
        {
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.plugins.dbdiff.ColumnDifference

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.