uroborosql icon indicating copy to clipboard operation
uroborosql copied to clipboard

[PLAN REVIEW] Multi-column IN clause support for DAO query interface

Open Copilot opened this issue 4 months ago • 4 comments

Status: AWAITING PLAN REVIEW

This PR currently contains only the modification plan document for adding multi-column IN clause support. Implementation will proceed after plan review and approval per the requirement: "まずはこのAPIを追加するための改修計画を立て、レビューの結果OKが出たら改修計画に従って修正を行ってください"

Modification Plan

Please review MODIFICATION_PLAN.md which contains a comprehensive plan including:

  1. 概要 - Overview and problem statement
  2. 現状の問題点 - Current limitations
  3. 目標とする実装 - Target implementation and API design
  4. 修正対象ファイル - Files to be modified with detailed change descriptions
  5. 技術的詳細 - Technical implementation details (reflection, column mapping, parameter binding)
  6. 既存機能への影響 - Impact analysis on existing features
  7. 実装手順 - Step-by-step implementation plan
  8. リスク分析 - Risk analysis and mitigation strategies
  9. 完了条件 - Completion criteria
  10. レビューポイント - Key review points

Proposed API (from plan)

The plan proposes adding support for IN clauses spanning multiple columns in entity queries. The current in() method only supports single-column conditions; this would add an overload accepting beans to enable multi-column tuple matching.

var inParamBeans = List.of(
    new InParamBean(1, "商品1"), 
    new InParamBean(2, "商品2")
);

agent().query(Product.class)
    .in(inParamBeans)
    .collect();

Would generate:

WHERE (PRODUCT_ID, PRODUCT_NAME) IN ((?, ?), (?, ?))

Next Steps

  1. ✅ Modification plan created (MODIFICATION_PLAN.md)
  2. Awaiting plan review and approval
  3. ⬜ Implementation (after approval)
  4. ⬜ Testing and validation
  5. ⬜ Final review
  • Addresses future-architect/uroborosql#373
Original prompt

This section details on the original issue you should resolve

<issue_title>DAOインタフェースのin() メソッドで複数列に対する条件指定ができるようにする</issue_title> <issue_description>現在uroborosqlで提供されているINメソッドは以下のようなAPIを提供している。

agent().query(Product.class)
    .in("productId", List.of(1, 2))
    .collect();

しかし、このAPIでは、複数カラムに対するIN句には対応できていないため、新たに複数カラムのIN句に対応するAPIを追加したい。

発行するSQLは以下のようになる

select
    (productテーブルのカラム)
from product t
where
   (t.product_id, t.product_name) in ((1, '商品1'), (2, '商品2'))

これに対応するAPIは

var inParamBeans = List.of(new InParamBean(1, "商品1"), new InParamBean(2, "商品2")); // InParamBeanは productIdとproductNameをフィールドに持つJavaBean

agent().query(Product.class)
    .in(inParamBeans)
    .collect();

</issue_description>

<agent_instructions>まずはこのAPIを追加するための改修計画を立て、レビューの結果OKが出たら改修計画に従って修正を行ってください</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes future-architect/uroborosql#373

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Oct 26 '25 08:10 Copilot