title: Which steps enable SQLite with Spring-Boot and JPA?
body: <p>To run SQLite with a Spring-boot (Version 1.2.3.RELEASE) application, I did these three steps:</p>
  
  <ol>
  <li><p>use the SQLiteDialect class from <a href="https://stackoverflow.com/questions/24232892/spring-boot-and-sqlite">Spring boot and SQLite</a></p></li>
  <li><p>provide a JDBC driver; we used
  org.xerial:sqlite-jdbc (<a href="http://mvnrepository.com/artifact/org.xerial/sqlite-jdbc/3.8.7" rel="nofollow noreferrer">http://mvnrepository.com/artifact/org.xerial/sqlite-jdbc/3.8.7</a>)</p></li>
  <li><p>configure the datasource; here with a spring-boot .yml file:</p>
  
  <pre><code>   spring:
    datasource:
      url: jdbc:sqlite:&lt;full-path-to-file&gt;.db
      username: ...
      password: ...
      driverClassName: org.sqlite.JDBC
      ...
    jpa:
      database: SQLITE
      dialect: that.custom.SQLiteDialect
      hibernate:
        ddl-auto: update
  </code></pre></li>
  </ol>
  
  <p>Now, that's not enough. It ends with a "No enum constant org.springframework.orm.jpa.vendor.Database.SQLITE" error:</p>
  
  <pre><code>Field error in object 'spring.jpa' on field 'database': rejected value [SQLITE]; codes [typeMismatch.spring.jpa.database,typeMismatch.database,typeMismatch.org.springframework.orm.jpa.vendor.Database,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [spring.jpa.database,database]; arguments []; default message [database]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.orm.jpa.vendor.Database' for property 'database'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type org.springframework.orm.jpa.vendor.Database for value 'SQLITE'; nested exception is java.lang.IllegalArgumentException: No enum constant org.springframework.orm.jpa.vendor.Database.SQLITE]
  </code></pre>
  
  <p>Indeed the <em>org.springframework.orm.jpa.vendor.Database</em> class has no SQLITE value, sadly.
  However, the spring doc (<a href="http://docs.spring.io/spring-framework/docs/2.5.6/api/org/springframework/orm/jpa/vendor/Database.html" rel="nofollow noreferrer">http://docs.spring.io/spring-framework/docs/2.5.6/api/org/springframework/orm/jpa/vendor/Database.html</a>) states:</p>
  
  <blockquote>
    <p>If a given PersistenceProvider supports a database not listed here, the strategy class can still be specified using the fully-qualified class name.</p>
  </blockquote>
  
  <p>That looks like I have to:</p>
  
  <ol>
  <li><p>remove the pointless</p>
  
  <p>jpa:
  database: SQLITE</p></li>
  </ol>
  
  <p>configuration piece above, and</p>
  
  <ol start="2">
  <li>Provide some "strategy class" instead.</li>
  </ol>
  
  <p><em>Am I on the right path here ?</em></p>
  
  <p><em>What do they mean with "strategy class" and how to get or implement it ?</em></p>
  
  <h2>UPDATE</h2>
  
  <p>Solution: According to the comment of M. Deinum, the right configuration reads:</p>
  
  <pre><code>       spring:
        datasource:
          url: jdbc:sqlite:&lt;full-path-to-file&gt;.db
          username: ...
          password: ...
          driverClassName: org.sqlite.JDBC
          ...
        jpa:
          database-platform: that.custom.SQLiteDialect
          hibernate:
            ddl-auto: update
  </code></pre>
  
  <p>Seems like no "strategy class" needs to be implemented at all.<br>
  I've got it now: The removed <code>jpa: database: SQLITE</code> line (which corresponds to that <em>org.springframework.orm.jpa.vendor.Database</em> class) is not mandatory at all. It's a convenience way -- for most databases but not SQLite.</p>
  
  <p>Remark: When using Hibernate, that <code>database-platform=...</code> entry is like <code>hibernate.dialect=that.custom.SQLiteDialect</code> in a Hibernate specific configuration, which would take the same effect.</p>