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 NEXTVAL('sequence')", 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

  @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("VALUES NEXTVAL FOR sequence", result);
  }
View Full Code Here

    return this.find(this.sequences(), sequence, this.defaultSchemas());
  }
 
  private <T> T find(Map<QualifiedName, T> map, String raw, List<String> defaultSchemaList)
  {
    QualifiedName name = this.nameFactory.parse(raw);

    T properties = map.get(name);
   
    if ((properties == null) && (name.getSchema() == null))
    {
      Iterator<String> schemas = defaultSchemaList.iterator();
      while ((properties == null) && schemas.hasNext())
      {
        properties = map.get(this.nameFactory.createQualifiedName(schemas.next(), raw));
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

    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

  }

  @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

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.