예제 #1
0
  private void writeSequence(DdlWrite writer, CreateTable createTable) throws IOException {

    // explicit sequence use or platform decides
    String explicitSequenceName = createTable.getSequenceName();
    int initial = toInt(createTable.getSequenceInitial());
    int allocate = toInt(createTable.getSequenceAllocate());

    String seqName = namingConvention.sequenceName(createTable.getName(), explicitSequenceName);
    String createSeq = platformDdl.createSequence(seqName, initial, allocate);
    if (createSeq != null) {
      writer.apply().append(createSeq).newLine();
      writer.rollback().append(platformDdl.dropSequence(seqName)).endOfStatement();
    }
  }
예제 #2
0
  /** Return the constraint name. */
  protected String determineCheckConstraintName(String tableName, String columnName) {

    return namingConvention.checkConstraintName(tableName, columnName, ++countCheck);
  }
예제 #3
0
  /** Return the unique constraint name. */
  protected String determineUniqueConstraintName(String tableName, String columnName) {

    return namingConvention.uniqueConstraintName(tableName, columnName, ++countUnique);
  }
예제 #4
0
  /** Return the foreign key constraint name given a single column foreign key. */
  protected String determineForeignKeyIndexName(String tableName, String[] columns) {

    return namingConvention.foreignKeyIndexName(tableName, columns, ++countIndex);
  }
예제 #5
0
  /** Return the foreign key constraint name given a single column foreign key. */
  protected String determineForeignKeyConstraintName(String tableName, String columnName) {

    return namingConvention.foreignKeyConstraintName(tableName, columnName, ++countForeignKey);
  }
예제 #6
0
  /** Return the primary key constraint name. */
  protected String determinePrimaryKeyName(String tableName) {

    return namingConvention.primaryKeyName(tableName);
  }