Interface RevengDialect

All Known Implementing Classes:
AbstractMetaDataDialect, CachedMetaDataDialect, H2MetaDataDialect, HSQLMetaDataDialect, JDBCMetaDataDialect, MySQLMetaDataDialect, OracleMetaDataDialect, SQLServerMetaDataDialect

public interface RevengDialect
Interface for fetching metadata from databases. The dialect is configured with a ConnectionProvider but is not required to actually use any connections. The metadata methods all returns Iterator and allows for more efficient and partial reads for those databases that has "flakey" JDBC metadata implementions.
Author:
Max Rydahl Andersen
  • Method Details

    • configure

      void configure(org.hibernate.engine.jdbc.connections.spi.ConnectionProvider connectionProvider)
      Configure the metadatadialect.
      Parameters:
      connectionProvider - a ConnectionProvider
    • getTables

      Iterator<Map<String,Object>> getTables(String catalog, String schema, String table)
      Return iterator over the tables that mathces catalog, schema and table
      Parameters:
      catalog - name or null
      schema - name or null
      table - name or null
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "TABLE_TYPE" keys.
    • close

      void close(Iterator<?> iterator)
      Close the iterator.
      Parameters:
      iterator - an iterator returned from one of methods on this dialect
    • getIndexInfo

      Iterator<Map<String,Object>> getIndexInfo(String catalog, String schema, String table)
      Return iterator over the indexes that mathces catalog, schema and table
      Parameters:
      catalog - name or null
      schema - name or null
      table - name or null
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "INDEX_NAME", "COLUMN_NAME", "NON_UNIQUE", "TYPE" keys.
    • getColumns

      Iterator<Map<String,Object>> getColumns(String catalog, String schema, String table, String column)
      Return iterator over the columns that mathces catalog, schema and table
      Parameters:
      catalog - name or null
      schema - name or null
      table - name or null
      column - name or null
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "DATA_TYPE", "TYPE_NAME", "COLUMN_NAME", "NULLABLE", "COLUMN_SIZE", "DECIMAL_DIGITS"
    • getPrimaryKeys

      Iterator<Map<String,Object>> getPrimaryKeys(String catalog, String schema, String name)
      Return iterator over the columns that mathces catalog, schema and table
      Parameters:
      catalog - name or null
      schema - name or null
      table - name or null
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "COLUMN_NAME", "KEY_SEQ", "PK_NAME",
    • getExportedKeys

      Iterator<Map<String,Object>> getExportedKeys(String catalog, String schema, String table)
      Return iterator over the exported foreign keys that mathces catalog, schema and table
      Parameters:
      catalog - name or null
      schema - name or null
      table - name or null
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "FKTABLE_CAT", "FKTABLE_SCHEM", "FKTABLE_NAME", "FK_NAME", "KEY_SEQ"
    • needQuote

      boolean needQuote(String name)
      Does this name need quoting
      Parameters:
      name -
      Returns:
    • close

      void close()
      Close any resources this dialect might have used.
    • getSuggestedPrimaryKeyStrategyName

      Iterator<Map<String,Object>> getSuggestedPrimaryKeyStrategyName(String catalog, String schema, String table)
      Use database (possible native) metadata to suggest identifier strategy.
      Parameters:
      catalog -
      schema -
      name -
      Returns:
      iterator with map elements that has "TABLE_NAME", "TABLE_SCHEMA", "TABLE_CAT", "HIBERNATE_STRATEGY" (null if no possible to determine strategy, otherwise return hibernate identifier strategy name/classname)