【发布时间】:2020-09-14 11:32:17
【问题描述】:
我的 PostgreSQL 包含一个类似
的枚举create type my_type as enum('VAL1', 'VAL2')
在Spring boot app中,用MyType.class enum表示
我正在尝试使用DatabasClient 运行一个简单的查询
client.exectute("select * from table where type = :type")...
我得到一个错误:
ceptionFactory$PostgresqlBadGrammarException: operator does not exist: type = character varying
将类型转换为 my_type 不起作用(使用 CAST 和 ::)
我已经为 MyType.class 注册了一个特定的编解码器,该编解码器可以工作 - 无条件查询所有内容都可以使用相关的 @ReadingConverter
【问题讨论】:
标签: spring-data spring-data-r2dbc r2dbc-postgresql