java - H2 控制台在配置和使用嵌入式本地持久性时不显示 Spring Boot 创建的表,即使它们存在
问题描述
jdbc:h2:[file:][<path>]<databaseName>
我已经使用 Spring Data JPA 抽象将 H2 设置为带有 Spring Boot的嵌入式持久数据库('Embedded (Local) Database' with ),如下所示
spring.datasource.url=jdbc:h2:file:/home/data/embeddeddb;CACHE_SIZE=${spring.datasource.cache.size:131072}
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=someusr
spring.datasource.password=somepwd
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=none
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
#spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=true
我将 放在schema.sql
我的项目下resources
,发现我能够通过CrudRepository
. 如上所示,我还通过属性启用了 h2 控制台。
但是,当我使用我指定的相同 URL(如上)从 h2 控制台连接到数据库时,它不会显示我创建的表或配置的缓存大小。
这即使我可以使用@Query
我的方法CrudRepository
来查看它们是否存在。
我不确定我在这里缺少什么,有人可以解释一下吗?
谢谢
解决方案
推荐阅读
- php - 如何将数据从 PHP 传递到 PHP 文件
- android - 我需要更改 android 小部件中按钮的颜色
- laravel - laravel 中的 Jstree
- machine-learning - 交叉验证的实现
- javascript - 部分文本未显示在屏幕上。JavaScript 初学者
- angular - 从服务返回的值未转移到组件
- scala - Scala spark:有效检查条件是否在任何地方匹配?
- javascript - Vue .native on 事件有时需要有时不需要(在同一个组件中)
- c# - 如何扩展派生类中虚拟成员的访问修饰符?
- mysql - MySQL限制时间范围内分组的记录数