【问题标题】:Nested entities are not supported in r2dbcEntityTemplate.insertr2dbcEntityTemplate.insert 不支持嵌套实体
【发布时间】:2021-12-09 22:56:34
【问题描述】:

我有 2 个实体作为批处理和批处理详细信息实体。我尝试使用 spring boot reactor r2dbcEntityTemplate.insert() 将记录插入到我的数据库 postgresql 中,但出现不支持嵌套实体等错误。

我的代码

错误

【问题讨论】:

  • 请不要将代码上传为图片
  • 您能解释一下为什么需要insert(Mono.just(batchDetailEntity) 吗?而不仅仅是insert(batchDetailEntity)
  • 最初是这样,但有同样的错误& r2dbcEntityTemplate.insert() 采用 Mono 对象,所以只是这样修改,但没有运气。
  • insert(batchDetailEntity) 工作!!

标签: java spring postgresql spring-boot spring-data-jpa


【解决方案1】:

而不是insert(Mono.just(batchDetailEntity))insert(batchDetailEntity)它可能对你有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-21
    相关资源
    最近更新 更多