The Cannot resolve table 'user_group' is a warning that's typically seen in IntelliJ IDEA, it's not actually an error. It happens because IntelliJ IDEA does not know about the existence of a table named user_group because it's an intermediary table created by Hibernate to manage @ManyToMany relationships, not a table that you've explicitly created yourself.
The Hibernate runtime knows to create the user_group table based on the configuration in your User entity, but IntelliJ IDEA's static code analysis doesn't know this, and so it raises a warning.
You can safely ignore this warning. When you run your application, Hibernate will automatically create the user_group table for you.
However, if you want to get rid of this warning in IntelliJ IDEA, you can use the JPA Console to update the IntelliJ IDEA schema:
- Open the Persistence tool window by going to View -> Tool Windows -> Persistence.
- Click on the JPA Console tool button.
- In the JPA Console, execute this command: update
This will update the IntelliJ IDEA schema with your Hibernate/JPA schema and the warning should go away. Please ensure that you have correctly set up the data source in IntelliJ IDEA.
Remember, Cannot resolve table is a warning from the IDE and not an error from the Java compiler or the runtime environment. Your code should compile and run correctly despite this warning.
'Java > Spring Boot JPA' 카테고리의 다른 글
[Trouble Shooting] AopInvocationException Handling (0) | 2023.08.03 |
---|---|
[Slack] 2.10.0 은 작동하지 않는다 -> 1.30.0 으로 납치 (0) | 2023.07.20 |
[예약어 조지기] 미리 예약된 예약어는 issue 를 발생 시킨다. (0) | 2023.07.18 |
[Slack] Integration Slack API (0) | 2023.07.14 |
[JPA] SQL N/A statement / MySQL 1064 & 42000 (0) | 2023.07.11 |