title: Why does hibernate execute sql in clauses on initialisation
body: <p>I am running a sample app based on <a href="https://github.com/yahoo/elide-spring-boot-example" rel="nofollow noreferrer">https://github.com/yahoo/elide-spring-boot-example</a></p>
  <p>I removed all the elide references, added my own domains. Its now a basic spring boot app using hibernate.
  I updated the application.yaml with the following in order to</p>
  <ol>
  <li>Use my own SQL Server DB and dialect</li>
  <li>Ignore liquibase changelog</li>
  <li>Ignore ddl-auto</li>
  </ol>
  <pre><code>spring:
      application:
        name: Elide
      jpa:
        properties:
          hibernate:
            default_batch_fetch_size: 100
            query:
              plan_cache_max_size: 64
              plan_parameter_metadata_max_size: 32
              in_clause_parameter_padding: true
        hibernate:
          show_sql: true
          naming:
            physical-strategy: 'misc.CustomPhysicalNamingStrategy'
          dialect: 'org.hibernate.dialect.SQLServerDialect'
          ddl-auto: 'none'
          jdbc:
            use_scrollable_resultset: true       
      datasource:
        url: 'jdbc:sqlserver://localhost;databaseName=MYDATABASE'
        username: 'username'
        password: 'password'
        driver-class-name: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
        validation-query: &quot;SELECT 1&quot;    
      liquibase:
        change-log: 'classpath:db/changelog/changelog.xml'
        enabled: false
  </code></pre>
  <p>When running the app with debug output, I notice thousands of lines of select statements in the form</p>
  <pre><code>Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
  Static select for one-to-many ... select ... from AUDIT_DETAIL auditdetai0_ where auditdetai0_.AUDIT_ACTION_TYPE_ID in (?, ?, ?, ?, ?, ?, ?, ?, ?)
  </code></pre>
  <p>I have no specific queries written. I thought it might be the query plan cache as per
  <a href="https://stackoverflow.com/questions/31557076/spring-hibernate-query-plan-cache-memory-usage">Spring + Hibernate: Query Plan Cache Memory usage</a>
  but adding the plan_cache_max_size doesnt make any difference. Why are these queries generated, and what should I do to avoid prevent this?</p>