Skip to content

DAOインタフェースのin() メソッドで複数列に対する条件指定ができるようにする #373

@HidekiSugimoto189

Description

@HidekiSugimoto189

現在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();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions