Examples of BestRowIdentifier


Examples of net.sourceforge.squirrel_sql.fw.sql.dbobj.BestRowIdentifier

      final String table = ti.getSimpleName();

      final ResultSetColumnReader rdr = new ResultSetColumnReader(rs);
      while (rdr.next())
      {
        final BestRowIdentifier rid =
          new BestRowIdentifier(catalog, schema, table, rdr.getLong(1).intValue(), rdr.getString(2),
            rdr.getLong(3).shortValue(), rdr.getString(4), rdr.getLong(5).intValue(), rdr.getLong(7)
              .shortValue(), rdr.getLong(8).shortValue(), this);
        results.add(rid);
      }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.sql.dbobj.BestRowIdentifier

    classUnderTest = new SQLDatabaseMetaData(mockSqlConnection);
   
    BestRowIdentifier[] result = classUnderTest.getBestRowIdentifier(mockTableInfo);
   
    assertEquals(1, result.length);
    BestRowIdentifier rid = result[0];
    assertEquals(1, rid.getScope());
    assertEquals("aColumn", rid.getColumnName());
    assertEquals(3, rid.getSQLDataType());
    assertEquals("SMALLINT", rid.getTypeName());
    assertEquals(5, rid.getPrecision());
    assertEquals(7, rid.getScale());
    assertEquals(8, rid.getPseudoColumn());
   
    mockHelper.verifyAll();
  }
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.BestRowIdentifier

        assertTrue("BestRowIdentifier set should be empty by default", bris.isEmpty());
    }

    public void testAddBestRowIdentifier() {
        // create
        BestRowIdentifier id = factory.createBestRowIdentifier();
        // set scope
        id.setScopeType(BestRowIdentifierScopeType.SESSION);
        // add
        bean.addBestRowIdentifier(id);
        // check
        assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
    }
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.BestRowIdentifier

        assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
    }

    public void testDeleteBestRowIdentifier() {
        // create privilege
        BestRowIdentifier id = factory.createBestRowIdentifier();
        // set scope
        id.setScopeType(BestRowIdentifierScopeType.SESSION);
        // add
        bean.addBestRowIdentifier(id);
        // check
        assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
        // delete
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.BestRowIdentifier

        assertTrue("BestRowIdentifier set should be empty", bean.getBestRowIdentifiers().isEmpty());
    }

    public void testFindBestRowIdentifierByScopeType() {
        // create privilege
        BestRowIdentifier id = factory.createBestRowIdentifier();
        // set scope
        id.setScopeType(BestRowIdentifierScopeType.SESSION);
        // add
        bean.addBestRowIdentifier(id);
        // check
        assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
        // check
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.BestRowIdentifier

            }
            return null;
        }

        // find table best row identifier object
        BestRowIdentifier brId = table.findBestRowIdentifierByScopeType(scopeType);
        // check if null
        if (brId == null) {
            // create
            brId = factory.createBestRowIdentifier();
        }

        // set scope type
        brId.setScopeType(scopeType);

        // determine if current record shows pseudo column
        boolean isPseudoColumn = ((getColumnPseudoType(pseudoColumn) != null) && (getColumnPseudoType(pseudoColumn) == ColumnPseudoType.PSEUDO));

        TableColumn column = null;

        if (isPseudoColumn) {
            // create
            column = factory.createTableColumn();

            // ***************************************
            // *** DatabaseNamedObject properties ***
            // ***************************************

            // name
            column.setName(columnName);
            // remarks
            // column.setRemarks (remarks); // N/A
            // TODO set extra properties
            // column.addExtraProperty (String key, Object value);

            // ***************
            // *** Column ***
            // ***************

            // owner
            column.setOwner(table);
            // SQL type
            column.setSqlType(getSqlType(dataType));
            // type name
            column.setTypeName(typeName);
            // precision
            column.setPrecision(precision);
            // size
            column.setSize(precision);
            // scale
            column.setRadix(scale);
            // pseudo type
            column.setPseudoType(getColumnPseudoType(pseudoColumn));
            // add to the table
            table.addColumn(column);
        } else {
            // trying to find column
            column = table.findColumnByName(columnName);

            // if column exists
            if (column != null) {
                // pseudo type
                column.setPseudoType(getColumnPseudoType(pseudoColumn));
            }
        }

        // if column exists
        if (column != null) {
            // add to the best row identifier
            brId.addColumn(column);
        }

        // add best row identifier to the table
        table.addBestRowIdentifier(brId);

        // get scope type string
        String scopeName = (brId.getScopeType() == null) ? null : brId.getScopeType().getName();

        // log
        if (traceLog.isDebugEnabled()) {
            traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) best row identifier with scope %s has been added.",
                                         database.getName(),
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.