Spring boot jpa with H2 database
<p>I am trying a sample code to run my Spring Boot data project with JPA for an H2 DB.</p>

<p>The code is below, application is running properly, but I don't see any table getting created, I don't see any error in the server console as well. I checked the logs, I don't see any queries getting created an fired. Am I am doing anything wrong?</p>

<p>Domain class:</p>

<pre><code>@Entity
public class Account {

    @Id
    @GeneratedValue
    private Integer accountId;

    private String name;

    private String accType;

    public Integer getAccountId() {
        return accountId;
    }

    public String getName() {
        return name;
    }

    public String getAccType() {
        return accType;
    }

    public Account(Integer accountId, String name, String accType) {
        super();
        this.accountId = accountId;
        this.name = name;
        this.accType = accType;
    }

    public Account(String name, String accType) {
        super();
        this.name = name;
        this.accType = accType;
    }
    public Account() {

    }
</code></pre>

<p>Data Loader class:</p>

<pre><code>@Component
public class AccountLoaded {

    private AccountRepository accountRepository;

    public AccountLoaded(AccountRepository accountRepository) {
        this.accountRepository = accountRepository;
    }

    @PostConstruct
    private void loadData() {
        Account account = new Account(1,"Madhu","Savings");
        accountRepository.save(account);
        System.out.println("Loaded Account " + account.toString());
    }

}
</code></pre>

<p>Repository class:</p>

<pre><code>@Repository
public interface AccountRepository extends CrudRepository&lt;Account, Integer&gt; {

}
</code></pre>

<p>application.properties:</p>

<pre><code>spring.datasource.jdbc-url=jdbc:h2:mem:test
spring.h2.console.enabled=true
spring.h2.console.path=/console
spring.datasource.platform=h2
</code></pre>

<p>My Logs in the server console:</p>

<pre><code>2016-10-11 12:38:26.202  INFO 20020 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2016-10-11 12:38:26.217  INFO 20020 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2016-10-11 12:38:26.285  INFO 20020 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.0.11.Final}
2016-10-11 12:38:26.287  INFO 20020 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2016-10-11 12:38:26.288  INFO 20020 --- [           main] org.hibernate.cfg.Environment            : HHH000021: Bytecode provider name : javassist
2016-10-11 12:38:26.327  INFO 20020 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2016-10-11 12:38:26.554  INFO 20020 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2016-10-11 12:38:26.995  INFO 20020 --- [           main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000227: Running hbm2ddl schema export
2016-10-11 12:38:27.004  INFO 20020 --- [           main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000230: Schema export complete
2016-10-11 12:38:27.044  INFO 20020 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
Loaded Account Account [accountId=1, name=Madhu, accType=Savings]
2016-10-11 12:38:27.587  INFO 20020 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@b472aa: startup date [Tue Oct 11 12:38:23 CDT 2016]; root of context hierarchy
2016-10-11 12:38:27.663  INFO 20020 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String, java.lang.Object&gt;&gt; org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-10-11 12:38:27.664  INFO 20020 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-10-11 12:38:27.696  INFO 20020 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.696  INFO 20020 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.732  INFO 20020 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.959  INFO 20020 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2016-10-11 12:38:28.011  INFO 20020 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-10-11 12:38:28.015  INFO 20020 --- [           main] com.example.SpringdataApplication        : Started SpringdataApplication in 4.898 seconds (JVM running for 5.255)
</code></pre>