最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to Use select new in Blaze-Persistence with unionAll? - Stack Overflow

programmeradmin1浏览0评论

I have a criteriaBuilder with a union all (Set operation) that I want to wrap as an ObjectBuilder (with select new)

    cb.with(ChangesCTE.class)
      .from(Changes.class)
      .bind...
      .where...
      .groupBy...
      .end()
          .from(ChangesCTE.class, "update")
          .innerJoinOn(entityClass, "entity")
          .on("update.id").onExpression("entity.id")
          .end()
          .where...
      .unionAll()
          .from(ChangesCTE.class, "update")
          .innerJoinOn(otherEntityClass, "otherEntity")
          .on("update.id").onExpression("otherEntity.id")
          .end()
          .where...
      .endSet()
      .orderByAsc...
      // .selectNew(EOB);

It does not allow to add selectNew, and if I force it I get an error:

        modifications to a query after connecting with a set operation is not allowed

how can I wrap it as an object builder? I need to change the tuple to EOB class.

发布评论

评论列表(0)

  1. 暂无评论