Hibernate 7: do repeated blocks of one association share a join, or does each block get its own?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with AssociationBlockJoinDecisionSpec, then compare the two test groups enabled by ALIAS_BLOCK_DECISION=shared and per-block. Read the related behavior and tests in #16773 and #16863, especially AssociationSortSpec, to understand the competing join and ordering rules. The work is complete when one rule is chosen, its tests define the contract, and the other test group is removed.
索引モデルが issue の本文から書いたものです。
説明
The question
When a criteria query names the same association in more than one block, does each block get its own join, or do they all share one?
Pet.withCriteria {
owner { scores { eq('round', 'first') } }
owner { scores { eq('round', 'second') } }
}
An owner has one score in each round. If the two scores blocks share a join, one score has to be in both rounds and no pet matches. If each block is its own scope, the pet of an owner with a score in each round matches.
What each version does today
| Query | Hibernate 5 | Hibernate 7 on 8.0.x |
Hibernate 7 with #16773 |
|---|---|---|---|
| the query above | no rows | the pet of the owner with both rounds | no rows |
one owner block that contains both scores blocks |
no rows | no rows | no rows |
two top-level likes blocks, x then y |
no rows | no rows | no rows |
Hibernate 5 and #16773 share the join. 8.0.x shares it for repeated blocks at the top level and inside one block, but not for a nested block under a repeated parent block, which looks like a side effect of how blocks are translated and not a rule. #16863 has tests that assert that result, six test cases in AssociationSortSpec.
A second question comes with it. When an association has several aliases or blocks, which join does an order by the path (order('scores.score')) sort by: the join of the first alias, as #16773 documents, or the join of the block the order is in, as #16863 asserts?
Why this is open
Hibernate 5 is not a reliable reference for this. Its rows for nested blocks depend on the order of the steps and on whether the criteria runs at the top or in a subquery, so it can only be one input. Both answers can be built on JPA. Each one changes the rows of an existing kind of query.
What is in place
AssociationBlockJoinDecisionSpec holds both answers as tests, each switched off until this is decided. The environment variable ALIAS_BLOCK_DECISION set to shared or per-block turns one group on, so either can be tried locally. Once decided, the chosen group becomes the contract and the other is deleted.
Related: #16773, #16863, #16866, #16851.
- 主要言語
- Groovy
- スター
- 2.9k
- フォーク
- 980
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 130
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/grails-core のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/grails-core#16874 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/grails-core#16858 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/grails-core#16289 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Update documentation for Java 25対応中かも @ruthst00 が 32 日前に担当しました。 オープンrelates-to: documentation weekly-action-item
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/grails-core#15725 ·
メンテナーはふだん 1 日以内に返信
-
type: improvement
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
apache/grails-core#16887 ·
メンテナーはふだん 1 日以内に返信
apache/grails-core の issue をすべて見る
似ている issue
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug implicit-state
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 4 日以内に返信