Is it possible to setup Persistence tab and JPA console in Intellij IDEA with annotation-based Spring-boot project, generated with JHipster (to test JPA queries etc.)? Any clues and any experience will be very much appreciated.
2 Answers
I'm using jhipster generator and the following worked for me
Define a persistence.xml file with your database configuration (name doesnt matter) you can copy a sample form here https://gist.github.com/rafaeltuelho/fb7fc0d372a0cf85a53e
Then the in Persistence tab you should be able to see this configuration and open de JPA console. I tried do a simple count query and it works,
select count(u) from User u
Also if I place attributes it works
select u.firstName, u.lastName from User u
But when i want to query all user object it fails, with
StreamCorruptedException: invalid stream header: 32303136
I'm not 100% sure but seems the issue is related with ZonedDateTime. This question is related JPA support for Java 8 new date and time API

- 1
- 1
I was finally able to setup this feature with IDEA 2017+ The only problem was the SQL generation issue which was resolved with this workaround: https://youtrack.jetbrains.com/issue/IDEA-216295

- 3,403
- 2
- 24
- 32