Examples of TableColumnInfo


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

  private void testAlterColumnName(ISession session) throws Exception
  {
    final HibernateDialect dialect = getDialect(session);

    final TableColumnInfo newNameCol =
      getVarcharColumn(newNameColumeName, testTableZeroTableName, true, null, "A column to be renamed");

    final AlterColumnNameSqlExtractor extractor = new AlterColumnNameSqlExtractor(renameCol, newNameCol);
    if (dialectDiscoveryMode)
    {
View Full Code Here

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

     * TableColumnInfo nullintVC = getVarcharColumn("nullint", true, "defVal",
     * "A varchar comment"); String alterColTypeSQL =
     * dialect.getColumnTypeAlterSQL(firstCol, nullintVC); runSQL(session,
     * alterColTypeSQL);
     */
    final TableColumnInfo thirdColLonger =
      getVarcharColumn(nullVarcharColumnName, testTableThreeTableName, true, "defVal",
        "A varchar comment", 30);

    final AlterColumnTypeSqlExtractor extractor = new AlterColumnTypeSqlExtractor(thirdCol, thirdColLonger);
    if (dialectDiscoveryMode)
View Full Code Here

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

  }

  private void testAlterNull(ISession session) throws Exception
  {
    final HibernateDialect dialect = getDialect(session);
    final TableColumnInfo notNullThirdCol =
      getVarcharColumn(nullVarcharColumnName, testTableThreeTableName, false, "defVal",
        "A varchar comment");

    final AlterColumnNullSqlExtractor extractor = new AlterColumnNullSqlExtractor(notNullThirdCol);
    if (dialectDiscoveryMode)
View Full Code Here

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

    final List<TableColumnInfo> columns = new ArrayList<TableColumnInfo>();
    final String catalog = getDefaultCatalog(session);
    final String schema = getDefaultSchema(session);
    final String columnName = "firstCol";

    final TableColumnInfo firstCol =
      new TableColumnInfo(catalog, schema, testCreateTable, columnName, Types.BIGINT, "BIGINT", 10, 0, 0,
        1, null, null, 0, 0, "YES");
    columns.add(firstCol);
    final List<TableColumnInfo> pkColumns = null;
    final CreateTableSqlExtractor extractor =
      new CreateTableSqlExtractor(testCreateTable, columns, pkColumns);
View Full Code Here

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

    if (!nullable)
    {
      isNullable = "NO";
      isNullAllowed = DatabaseMetaData.columnNoNulls;
    }
    final TableColumnInfo result = new TableColumnInfo("testCatalog", // catalog
      "testSchema", // schema
      tableName, // tableName
      name, // columnName
      dataType, // dataType
      dataTypeName, // typeName
View Full Code Here

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

  }

  public void setCatalogs(String[] catalogNames, SQLDatabaseMetaData md)
  {
    catalogs = new MockResultSet();
    TableColumnInfo[] cols = new TableColumnInfo[] { new TableColumnInfo("aCatalog", // catalog
      "aSchema", // schema
      "", // tableName
      "", // columnName
      1, // dataType; 1 == CHAR
      "", // typeName
View Full Code Here

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

  }

  public void setSchemas(String[] schemaNames, SQLDatabaseMetaData md)
  {
    schemas = new MockResultSet(null);
    TableColumnInfo[] cols = new TableColumnInfo[] { new TableColumnInfo("aCatalog", // catalog
      "aSchema", // schema
      "", // tableName
      "", // columnName
      1, // dataType; 1 == CHAR
      "", // typeName
View Full Code Here

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

  @Test
  public void testGetColumnNameAlter()
  {
    setCommonExpectations();

    TableColumnInfo mockToInfo = mockHelper.createMock(TableColumnInfo.class);
    expect(mockToInfo.getColumnName()).andStubReturn("aNewColumnName");

    mockHelper.replayAll();

    try
    {
View Full Code Here

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

    // Oracle won't allow in-place conversion between CLOB and VARCHAR
    if ((from.getDataType() == Types.VARCHAR && to.getDataType() == Types.CLOB)
      || (from.getDataType() == Types.CLOB && to.getDataType() == Types.VARCHAR))
    {
      // add <columnName>_2 null as CLOB
      TableColumnInfo newInfo = DialectUtils.getRenamedColumn(to, to.getColumnName() + "_2");

      String[] addSQL = this.getAddColumnSQL(newInfo, qualifier, prefs);
      for (int i = 0; i < addSQL.length; i++)
      {
        result.add(addSQL[i]);
      }

      // update table set <columnName>_2 = <columnName>
      StringBuilder updateSQL = new StringBuilder();
      updateSQL.append("update ");
      updateSQL.append(from.getTableName());
      updateSQL.append(" set ");
      updateSQL.append(newInfo.getColumnName());
      updateSQL.append(" = ");
      updateSQL.append(from.getColumnName());
      result.add(updateSQL.toString());

      // drop <columnName>
View Full Code Here

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

        String schema = null;
        int octetLength = 1;
        int ordinalPosition = 1;
        int radix = 1;
       
        TableColumnInfo result =
            new TableColumnInfo(catalog,
                                schema,
                                tableName,
                                columnName,
                                dataType,
                                typeName,
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.