CNA Weird Stories

Former governor of Alaska, Sarah Palin went on “The Masked Singer” and rapped to Baby Got Back. She came on stage wearing a pink bear costume, surprising the judges and audiences. She was a one-time…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to add persistence support for Spring Boot project in IntelliJ Idea

When you have a Spring Boot project with JPA and using Hibernate to access a database, there is a strong feature in Intellij Idea which hast many benefits such as:

Unfortunately, sometime this feature is not active and I couldn't found any instruction on Jet-brain web site to run it.

This feature is only supported in the Ultimate edition.

1- I’ve created a Spring Boot project using Maven with the wizard and select Web, JPA and MySQL dependencies.

But persistence window doesn’t exist yet.

2- In Project Structure window, add JPA to Facets to the main module and at the bottom, set Default JPA Provider to Hibernate. (No need to add any descriptor)

3- Now you can see the Persistence tool window is appeared and automatically contains Entities as Persistence Unit.

4- At this step a DataSource should be added to project and (also set datasource properties in the application.properties)

5- You can create a database of defined entities by right click on Entities and select Generate Persistence Mapping and By Database Schema.

6- Now we reach to the best part, the JPA console to write your HQL or JPL and get the result instantly.

Add a comment

Related posts:

MODERN FREEDOM

The White race contains all impulses and talents within itself ... The Negro … undoubtedly holds the lowest of all remaining levels by which we designate the different races. Immanuel Kant¹ At first…

fire

everyone is the universe on fire some of us have been searching for water for years some of us don’t even realize we are burning and some of us are learning to catch sparks like snowflakes on our…

2.5 Years of Inactivity

I just remembered I had this blog of mine that I have not been maintaining since I enlisted. Anyway it has been 2 and a half years, which means, ORD LO! Earlier today, I was reading on my previous…