如何配置IntelliJ HQL控制台以使用Spring Boot

Spi*_*der 11 hibernate jpa hql intellij-idea spring-boot

我正在使用Spring Boot和IntelliJ.由于Spring Boot自动配置数据库,因此没有hibernate.cfg.xml文件.通常,当您要在控制台上执行HQL查询时,可以通过此配置文件进行连接.

https://www.jetbrains.com/idea/help/working-with-the-hibernate-console.html#d951572e120

不幸的是,我没有将该文件作为切入点.我还能如何执行HQL查询?

Mic*_*mal 2

您应该注册您的entityManagerFactory,然后在持久性选项卡中右键单击entityManagerFactory并选择控制台。(我使用的是 Intellij EAP 2018.1)

在此输入图像描述