Package net.sf.hajdbc

Examples of net.sf.hajdbc.QualifiedName


  }

  @Test
  public void getCreateForeignKeyConstraintSQL() throws SQLException
  {
    QualifiedName table = mock(QualifiedName.class);
    QualifiedName foreignTable = mock(QualifiedName.class);
    ForeignKeyConstraint constraint = mock(ForeignKeyConstraint.class);
   
    when(table.getDDLName()).thenReturn("table");
    when(foreignTable.getDDLName()).thenReturn("foreign_table");
    when(constraint.getName()).thenReturn("name");
    when(constraint.getTable()).thenReturn(table);
    when(constraint.getColumnList()).thenReturn(Arrays.asList("column1", "column2"));
    when(constraint.getForeignTable()).thenReturn(foreignTable);
    when(constraint.getForeignColumnList()).thenReturn(Arrays.asList("foreign_column1", "foreign_column2"));
View Full Code Here


  }

  @Test
  public void getCreateUniqueConstraintSQL() throws SQLException
  {
    QualifiedName table = mock(QualifiedName.class);
    UniqueConstraint constraint = mock(UniqueConstraint.class);
   
    when(table.getDDLName()).thenReturn("table");
    when(constraint.getName()).thenReturn("name");
    when(constraint.getTable()).thenReturn(table);
    when(constraint.getColumnList()).thenReturn(Arrays.asList("column1", "column2"));
   
    String result = this.dialect.getCreateUniqueConstraintSQL(constraint);
View Full Code Here

  }

  @Test
  public void getDropForeignKeyConstraintSQL() throws SQLException
  {
    QualifiedName table = mock(QualifiedName.class);
    QualifiedName foreignTable = mock(QualifiedName.class);
    ForeignKeyConstraint constraint = mock(ForeignKeyConstraint.class);
   
    when(table.getDDLName()).thenReturn("table");
    when(foreignTable.getDDLName()).thenReturn("foreign_table");
    when(constraint.getName()).thenReturn("name");
    when(constraint.getTable()).thenReturn(table);
    when(constraint.getColumnList()).thenReturn(Arrays.asList("column1", "column2"));
    when(constraint.getForeignTable()).thenReturn(foreignTable);
    when(constraint.getForeignColumnList()).thenReturn(Arrays.asList("foreign_column1", "foreign_column2"));
View Full Code Here

  }

  @Test
  public void getDropUniqueConstraintSQL() throws SQLException
  {
    QualifiedName table = mock(QualifiedName.class);
    UniqueConstraint constraint = mock(UniqueConstraint.class);
   
    when(table.getDDLName()).thenReturn("table");
    when(constraint.getName()).thenReturn("name");
    when(constraint.getTable()).thenReturn(table);
    when(constraint.getColumnList()).thenReturn(Arrays.asList("column1", "column2"));
   
    String result = this.dialect.getDropUniqueConstraintSQL(constraint);
View Full Code Here

  {
    SequenceSupport support = this.dialect.getSequenceSupport();
   
    if (support != null)
    {
      QualifiedName name = mock(QualifiedName.class);
      SequenceProperties sequence = mock(SequenceProperties.class);
     
      when(sequence.getName()).thenReturn(name);
      when(name.getDMLName()).thenReturn("sequence");
     
      String result = support.getNextSequenceValueSQL(sequence);
     
      assertEquals("SELECT NEXT VALUE FOR sequence", result);
    }
View Full Code Here

  @Test
  public void getTruncateTableSQL() throws SQLException
  {
    TableProperties table = mock(TableProperties.class);
    QualifiedName name = mock(QualifiedName.class);
   
    when(table.getName()).thenReturn(name);
    when(name.getDMLName()).thenReturn("table");
   
    String result = this.dialect.getTruncateTableSQL(table);
   
    assertEquals("DELETE FROM table", result);
  }
View Full Code Here

   
    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#getCreateForeignKeyConstraintSQL()
   */
  @Override
  public void getCreateForeignKeyConstraintSQL() throws SQLException
  {
    QualifiedName table = mock(QualifiedName.class);
    QualifiedName foreignTable = mock(QualifiedName.class);
    ForeignKeyConstraint constraint = mock(ForeignKeyConstraint.class);
   
    when(table.getDDLName()).thenReturn("table");
    when(foreignTable.getDDLName()).thenReturn("foreign_table");
    when(constraint.getName()).thenReturn("name");
    when(constraint.getTable()).thenReturn(table);
    when(constraint.getColumnList()).thenReturn(Arrays.asList("column1", "column2"));
    when(constraint.getForeignTable()).thenReturn(foreignTable);
    when(constraint.getForeignColumnList()).thenReturn(Arrays.asList("foreign_column1", "foreign_column2"));
View Full Code Here

   */
  @Override
  public void getNextSequenceValueSQL() throws SQLException
  {
    SequenceProperties sequence = mock(SequenceProperties.class);
    QualifiedName name = mock(QualifiedName.class);
   
    when(sequence.getName()).thenReturn(name);
    when(name.getDMLName()).thenReturn("sequence");

    String result = this.dialect.getSequenceSupport().getNextSequenceValueSQL(sequence);
   
    assertEquals("CALL NEXT VALUE FOR sequence", result);
  }
View Full Code Here

   */
  @Override
  public void getTruncateTableSQL() throws SQLException
  {
    TableProperties table = mock(TableProperties.class);
    QualifiedName name = mock(QualifiedName.class);
   
    when(table.getName()).thenReturn(name);
    when(name.getDMLName()).thenReturn("table");
   
    String result = this.dialect.getTruncateTableSQL(table);
   
    assertEquals("TRUNCATE TABLE table", result);
  }
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.QualifiedName

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.