Uploaded image for project: 'Hibernate ORM'
  1. HHH-9876

Ability to filter objects from Database for schema tooling

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.CR1
    • Fix Version/s: 5.1.0
    • Component/s: hibernate-core
    • Labels:
      None
    • Last commented by a user?:
      true
    • Sprint:

      Description

      Schema tooling (export, update, etc) all start with a Database object and iterate over its catalog/schema combos and then over tables and sequences within each catalog/schema. In pseudo-code:

      for ( Schema schema : database.getSchemas() ) {
          for ( Table table : schema.getTables() ) {
              ... do stuff
          }
      }
      

      Would be great to be able to apply filtering over this process, e.g.:

      for ( Schema schema : database.getSchemas() ) {
          if ( !filter.include( schema ) ) {
              continue;
          }
      
          for ( Table table : schema.getTables() ) {
              if ( !filter.include( table ) ) {
                  continue;
              }
              ... do stuff
          }
      }
      

      or:

      for ( Schema schema : filter.matches( database.getSchemas() ) ) {
          for ( Table table : filter.matches( schema.getTables() ) ) {
              ... do stuff
          }
      }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: