title: Spring boot can not find HIBERNATE_SEQUENCE
body: <p>For many applications all we will need is to put the right Spring 
  Data dependencies on the classpath.it works fine :</p>
  
  <p>config:</p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @EntityScan(basePackages = {"io.boot.spring.entities"})
  @EnableJpaRepositories(basePackages = {"io.boot.spring.repositories"})
  @EnableTransactionManagement
  public class ConfigForJPA {
  
  @Bean
  @ConfigurationProperties("spring.datasource.hikari")
  public HikariDataSource dataSource() {
      return (HikariDataSource) DataSourceBuilder.create()
              .type(HikariDataSource.class).build();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>application.properties:</p>
  
  <pre><code>spring.datasource.hikari.jdbc-url=jdbc:h2:mem:mydb
  spring.datasource.hikari.username=sa
  spring.datasource.hikari.password=
  spring.jpa.hibernate.ddl-auto=create-drop
  spring.jpa.show-sql=true
  spring.jpa.hibernate.use-new-id-generator-mappings=true
  </code></pre>
  
  <p>console:</p>
  
  <pre><code>Hibernate: drop table Blog if exists
  Hibernate: drop table Item if exists
  Hibernate: drop table Role if exists
  Hibernate: drop table User if exists
  Hibernate: drop table User_roles if exists
  Hibernate: drop sequence if exists hibernate_sequence
  Hibernate: create sequence hibernate_sequence start with 1 increment by 1
  Hibernate: create table Blog 
  Hibernate: create table Item 
  Hibernate: create table Role 
  Hibernate: create table User 
  Hibernate: create table User_roles (users_id integer not null, roles_id integer not null)
  main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000230: Schema export complete
  j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
  Hibernate: call next value for hibernate_sequence
  Hibernate: insert into Role (name, id) values (?, ?)
  Hibernate: call next value for hibernate_sequence
  Hibernate: insert into Role (name, id) values (?, ?)
  Hibernate: call next value for hibernate_sequence
  Hibernate: insert into User (email, name, password, id) values (?, ?, ?, ?)
  Hibernate: insert into User_roles (users_id, roles_id) values (?, ?)
  Hibernate: insert into User_roles (users_id, roles_id) values (?, ?)
  </code></pre>
  
  <p>but Spring boot doc says to take full control of the configuration of the 
  EntityManagerFactory, you need to add a @Bean named ‘entityManagerFactory’
  and when I add it to my config. </p>
  
  <p>config:</p>
  
  <pre><code>@Bean
  public LocalContainerEntityManagerFactoryBean 
      entityManagerFactory(EntityManagerFactoryBuilder builder) {
          return builder
                  .dataSource(dataSource())
                  .packages("io.boot.spring")
                  .persistenceUnit("io.boot.spring.entities")
                  .build();
  
      }
  </code></pre>
  
  <p>It gives the error:</p>
  
  <p>console:</p>
  
  <pre><code>: HHH000412: Hibernate Core {5.0.11.Final}
  : HHH000206: hibernate.properties not found
  : HHH000021: Bytecode provider name : javassist
  : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Started.
  : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
  j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory
   for persistence unit 'io.boot.spring.entities'
  Hibernate: call next value for hibernate_sequence
  : SQL Error: 90036, SQLState: 90036
  : Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:
  call next value for hibernate_sequence [90036-193]
  </code></pre>
  
  <p>why HIBERNATE_SEQUENCE not found? I did not modify anything
  just added the entityManagerFactory bean to config file</p>
  
  <p>Entity:</p>
  
  <pre><code>@Entity
  public class Role {
  
      @Id
      @GeneratedValue(strategy=GenerationType.SEQUENCE)
      private Integer id;
  
      private String name;
  
      ... getters and setters
  </code></pre>