Skip to content

GEM: 定型検索でカラム以外の式をOrder Byに設定した場合、実行時エラー#2039

Merged
xtakahashi-hiroyuki merged 5 commits into
masterfrom
feature/1960-gem-sort-fix
Apr 22, 2026
Merged

GEM: 定型検索でカラム以外の式をOrder Byに設定した場合、実行時エラー#2039
xtakahashi-hiroyuki merged 5 commits into
masterfrom
feature/1960-gem-sort-fix

Conversation

@xtakahashi-hiroyuki
Copy link
Copy Markdown
Contributor

@xtakahashi-hiroyuki xtakahashi-hiroyuki commented Apr 20, 2026

対応内容

closes #1960

動作確認・スクリーンショット(任意)

以下の条件分岐を網羅して動作確認(結果が正常に返る/ソート成功)した。

  • 重複行排除あり / 無し
  • 単純にカラム指定 / 以外の式
2026-04-22_14h37_48

レビュー観点・補足情報(任意)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

定型検索(GEM)の検索クエリ生成において、ORDER BY に「カラム以外の式」(例: case when ... end)を指定した場合に、実行時に EntityField 変換で落ちる問題(#1960)を回避するための修正です。

Changes:

  • ORDER BY の sortKey を toString() で文字列化して EntityField 化するのをやめ、ValueExpression として SELECT 句に取り込むように変更
  • SELECT 句の選択要素を Stream.concat(...).distinct() で統合して生成するよう整理

@xtakahashi-hiroyuki xtakahashi-hiroyuki changed the title GEM: 【定型検索】カラム以外の式をOrder Byに設定した場合、実行時エラー GEM: 定型検索でカラム以外の式をOrder Byに設定した場合、実行時エラー Apr 22, 2026
@xtakahashi-hiroyuki xtakahashi-hiroyuki force-pushed the feature/1960-gem-sort-fix branch from ff51901 to 1e8d345 Compare April 22, 2026 09:41
@xtakahashi-hiroyuki xtakahashi-hiroyuki merged commit f600044 into master Apr 22, 2026
4 checks passed
@xtakahashi-hiroyuki xtakahashi-hiroyuki deleted the feature/1960-gem-sort-fix branch April 22, 2026 09:49
xtakahashi-hiroyuki added a commit that referenced this pull request Apr 24, 2026
* GEM: 定型検索でカラム以外の式をOrder Byに設定した場合、実行時エラー (#2039)

* OrderByで式を指定した場合のエラー解消

* [refactor] 不要なoverride削除

* Revert "[refactor] 不要なoverride削除"

This reverts commit e200b84.

* レビュー対応:distinct時のSELECT列決定ロジックを改善

---------

Co-authored-by: Takahashi.Hiroyuki <xtakahashi.hiroyuki4@contract.dentsusoken.com>

* import追加

* Java 11 記法に修正

* レビュー対応:Java 8 API を使うように

---------

Co-authored-by: Takahashi.Hiroyuki <xtakahashi.hiroyuki4@contract.dentsusoken.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GEM: 定型検索でカラム以外の式をOrder Byに設定した場合、実行時エラー

3 participants