找不到与play和postgres的关系错误(而表确实存在) [英] Relation not found error with play and postgres (while table does exists)
问题描述
我有一个称为ETL_TABLES的表,该表位于公共模式上.在 我的application.conf我有以下一行:
I have a table called ETL_TABLES which resides on the public schema. In my application.conf I have the following line:
hibernate.default_schema=public
这应该意味着将postgres的search_path设置为公共模式.
that should mean the search_path of postgres is set to the public schema.
我有一个带有@Table(name="ETL_TABLES")
批注的类Tables
.
但是当我尝试访问实体类时,例如通过
Tables.findAll();
,然后错误显示关系"public.etl_tables"
不存在.
I have a class Tables
, with the @Table(name="ETL_TABLES")
annotation.
But when I try to access the entity class, for example by
Tables.findAll();
then the error says relation "public.etl_tables"
does not exist.
该表存在于postgres公共模式中,所以我在做什么 这里错了吗?
The table is present on the postgres public schema, so what am I doing wrong here ?
推荐答案
在我们的配置中,我显然需要在创建实体时编写以下代码:
Apperently in our configuration I need to write this when creating an entity:
@Table(name="\"ETL_TABLES\"")
所以我必须使用\来表示选择中需要的双引号.
So I have to use \" to represent the double quotes needed in the select.
这篇关于找不到与play和postgres的关系错误(而表确实存在)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!