Andrew S.
Andrew S.

Reputation: 922

Intellij Jpa console db schema

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

Upvotes: 9

Views: 2376

Answers (3)

LuckyCurve
LuckyCurve

Reputation: 49

first, New Database and specify schema with jdbc url, such like this:

jdbc:postgresql://www.test.xyz:27017/spring_boot?currentSchema=test

New Database and specify schema and then, open Persistence window and right-click Assign Data Sources... and assign data source before you register right-click Assign Data Sources IDEA Version: IntelliJ IDEA 2024.2 (Ultimate Edition)

Upvotes: 0

Andrew S.
Andrew S.

Reputation: 922

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

Upvotes: 5

Cepr0
Cepr0

Reputation: 30349

Did you do all those steps?:

enter image description here

(The IDEA version is 2019.1)

Upvotes: 7

Related Questions