Package net.sf.hajdbc

Examples of net.sf.hajdbc.ColumnProperties


        String column = resultSet.getColumnName(i);
        int type = resultSet.getColumnType(i);
        String nativeType = resultSet.getColumnTypeName(i);
        boolean autoIncrement = resultSet.isAutoIncrement(i);
       
        ColumnProperties properties = factory.createColumnProperties(column, type, nativeType, null, null, autoIncrement);
        map.put(properties.getName(), properties);
      }
     
      return map;
    }
    finally
View Full Code Here


  }

  @Test
  public void getColumnType() throws SQLException
  {
    ColumnProperties column = mock(ColumnProperties.class);
   
    when(column.getType()).thenReturn(Types.INTEGER);
   
    int result = this.dialect.getColumnType(column);
   
    assertEquals(Types.INTEGER, result);
  }
View Full Code Here

    IdentityColumnSupport support = this.dialect.getIdentityColumnSupport();
   
    if (support != null)
    {
      TableProperties table = mock(TableProperties.class);
      ColumnProperties column = mock(ColumnProperties.class);
      QualifiedName name = mock(QualifiedName.class);
     
      when(table.getName()).thenReturn(name);
      when(name.getDDLName()).thenReturn("table");
      when(column.getName()).thenReturn("column");
     
      String result = support.getAlterIdentityColumnSQL(table, column, 1000L);
     
      assertEquals("ALTER TABLE table ALTER COLUMN column RESTART WITH 1000", result);
    }
View Full Code Here

   * @see net.sf.hajdbc.dialect.StandardDialectTest#getColumnType()
   */
  @Override
  public void getColumnType() throws SQLException
  {
    ColumnProperties column = mock(ColumnProperties.class);
   
    when(column.getNativeType()).thenReturn("oid");
   
    int result = this.dialect.getColumnType(column);
   
    assertEquals(Types.BLOB, result);
   
    when(column.getNativeType()).thenReturn("int");   
    when(column.getType()).thenReturn(Types.INTEGER);
   
    result = this.dialect.getColumnType(column);
   
    assertEquals(Types.INTEGER, result);
  }
View Full Code Here

   */
  @Override
  public void getAlterIdentityColumnSQL() throws SQLException
  {
    TableProperties table = mock(TableProperties.class);
    ColumnProperties column = mock(ColumnProperties.class);
    QualifiedName name = mock(QualifiedName.class);
   
    when(table.getName()).thenReturn(name);
    when(name.getDDLName()).thenReturn("table");
    when(column.getName()).thenReturn("column");
   
    String result = this.dialect.getIdentityColumnSupport().getAlterIdentityColumnSQL(table, column, 1000L);

    assertEquals("ALTER SEQUENCE table_column_seq RESTART WITH 1000", result);
  }
View Full Code Here

        String column = resultSet.getColumnName(i);
        int type = resultSet.getColumnType(i);
        String nativeType = resultSet.getColumnTypeName(i);
        boolean autoIncrement = resultSet.isAutoIncrement(i);
       
        ColumnProperties properties = factory.createColumnProperties(column, type, nativeType, null, null, autoIncrement);
        map.put(properties.getName(), properties);
      }
     
      return map;
    }
    finally
View Full Code Here

  }

  @Test
  public void getColumnType() throws SQLException
  {
    ColumnProperties column = mock(ColumnProperties.class);
   
    when(column.getType()).thenReturn(Types.INTEGER);
   
    int result = this.dialect.getColumnType(column);
   
    assertEquals(Types.INTEGER, result);
  }
View Full Code Here

    IdentityColumnSupport support = this.dialect.getIdentityColumnSupport();
   
    if (support != null)
    {
      TableProperties table = mock(TableProperties.class);
      ColumnProperties column = mock(ColumnProperties.class);
      QualifiedName name = mock(QualifiedName.class);
     
      when(table.getName()).thenReturn(name);
      when(name.getDDLName()).thenReturn("table");
      when(column.getName()).thenReturn("column");
     
      String result = support.getAlterIdentityColumnSQL(table, column, 1000L);
     
      assertEquals("ALTER TABLE table ALTER COLUMN column RESTART WITH 1000", result);
    }
View Full Code Here

        String column = resultSet.getColumnName(i);
        int type = resultSet.getColumnType(i);
        String nativeType = resultSet.getColumnTypeName(i);
        boolean autoIncrement = resultSet.isAutoIncrement(i);
       
        ColumnProperties properties = factory.createColumnProperties(column, type, nativeType, null, null, autoIncrement);
        map.put(properties.getName(), properties);
      }
     
      return map;
    }
    finally
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.ColumnProperties

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.