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

Optimize the SQL formatter call when iterating through multiple targets

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.7
    • Fix Version/s: 5.2.8
    • Component/s: hibernate-core
    • Labels:
      None

      Description

      Instead of this:

      for ( GenerationTarget target : targets ) {
          try {
              target.accept( formatter.format( sqlString ) );
          }
          catch (CommandAcceptanceException e) {
              if ( !quiet ) {
                  options.getExceptionHandler().handleException( e );
              }
              // otherwise ignore the exception
          }
      }
      

      we could do this:

      for ( GenerationTarget target : targets ) {
          String formattedSql = formatter.format( sqlString );
          try {
              target.accept( formattedSql );
          }
          catch (CommandAcceptanceException e) {
              if ( !quiet ) {
                  options.getExceptionHandler().handleException( e );
              }
              // otherwise ignore the exception
          }
      }
      

      This is valid for multiple classes in the org.hibernate.tool.schema.internal package.

        Attachments

          Activity

            People

            • Assignee:
              mih_vlad Vlad Mihalcea
              Reporter:
              mih_vlad Vlad Mihalcea
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: