4

When I want make query in Intellij JPA console I get error that relation "topic" does not exist. Jpql query select t from Topic t. I'm using spring boot, I added jpa to module, persistence toolbar works well, but jpa console doesn't. My thougs that JPA Console not find in right db schema, but datasource selected corect.

JPA console print: [2019-07-19 12:49:59] [42P01] ERROR: relation "topic" does not exist [2019-07-19 12:49:59] Position: 60

Andrew Sneck
  • 516
  • 7
  • 15

2 Answers2

7

Did you do all those steps?:

enter image description here

(The IDEA version is 2019.1)

Cepr0
  • 24,708
  • 7
  • 67
  • 95
  • very nice animation, I have all set as you show, but if i try hibernate console it ends by exception: `[2019-07-20 23:11:30] org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in FILE C:\Users\ondra\.IntelliJIdea2019.1\system\compiler\agent-chat.87f53839\.generated\Jpa_Console\agent-chat.main-hibernate-1563657080743.cfg.xml. Message: null [2019-07-20 23:11:30] javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.` – Andrew Sneck Jul 20 '19 at 21:12
  • @AndrewSneck Maybe it's related to [JAXB-API and Java version](https://stackoverflow.com/q/51916221/5380322) issue somehow? – Cepr0 Jul 21 '19 at 09:51
  • I add this dependecies: `implementation "javax.xml.bind:jaxb-api:2.2.11" implementation "com.sun.xml.bind:jaxb-core:2.2.11" implementation "com.sun.xml.bind:jaxb-impl:2.2.11" implementation "javax.activation:activation:1.1.1"` and hibernate console now show same error as jpa console specifically: ERROR: relation "topic" does not exist – Andrew Sneck Jul 22 '19 at 08:59
3

I found my mistake in connection to database. I had in field Database value postgres, I replace by chatapp - it is correct schema, and now it works well

Database settings

Andrew Sneck
  • 516
  • 7
  • 15