Package net.sf.hajdbc

Examples of net.sf.hajdbc.QualifiedName


   */
  @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("SELECT sequence.NEXTVAL FROM DUAL", 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

   * @see net.sf.hajdbc.dialect.StandardDialectTest#getDropForeignKeyConstraintSQL()
   */
  @Override
  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

   * @see net.sf.hajdbc.dialect.StandardDialectTest#getCreateUniqueConstraintSQL()
   */
  @Override
  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

   * @see net.sf.hajdbc.dialect.StandardDialectTest#getDropUniqueConstraintSQL()
   */
  @Override
  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

   */
  @Override
  public void getAlterSequenceSQL() throws SQLException
  {
    SequenceProperties sequence = mock(SequenceProperties.class);
    QualifiedName name = mock(QualifiedName.class);
   
    when(sequence.getName()).thenReturn(name);
    when(name.getDDLName()).thenReturn("sequence");
    when(sequence.getIncrement()).thenReturn(1);
   
    String result = this.dialect.getSequenceSupport().getAlterSequenceSQL(sequence, 1000L);
   
    assertEquals("ALTER SEQUENCE sequence INCREMENT BY (1000 - (SELECT sequence.NEXTVAL FROM DUAL)); SELECT sequence.NEXTVAL FROM DUAL; ALTER SEQUENCE sequence INCREMENT BY 1", 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 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

   */
  @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("SELECT sequence.NEXTVAL FROM DUAL", result);
  }
View Full Code Here

    SequenceSupport support = this.dialect.getSequenceSupport();
   
    if (support != null)
    {
      SequenceProperties sequence = mock(SequenceProperties.class);
      QualifiedName name = mock(QualifiedName.class);
     
      when(sequence.getName()).thenReturn(name);
      when(name.getDDLName()).thenReturn("sequence");
      when(sequence.getIncrement()).thenReturn(1);
     
      String result = support.getAlterSequenceSQL(sequence, 1000L);
     
      assertEquals("ALTER SEQUENCE sequence RESTART WITH 1000", 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.