方法一:修改yml配置文件
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/database?currentSchema=你要查的表的模式
username: xxx
password: xxx
方法二:使用注解(推荐)
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/database
username: xxx
password: xxx
然后在所需实体类上添加
@TableName("你要查的表的模式.你要查的表")
@TableName("你要查的表的模式.\"表名有大写字母的表\"")