[CONTAINER-102] S2JDBC で,AutoSelect の where() で OR を使うための ComplexWhere クラスを追加しました. Created: 2007-10-25 Updated: 2007-10-30 Resolved: 2007-10-30 |
|
Status: | Resolved |
Project: | S2Container |
Component/s: | S2-Tiger |
Affects Version/s: | 2.4.18-rc1 |
Fix Version/s: | 2.4.18-rc2 |
Type: | New Feature | Priority: | Major |
Reporter: | koichik | Assignee: | koichik |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
S2JDBC で,AutoSelect の where() に or を使えるようにする. |
Comments |
Comment by koichik [ 2007-10-30 ] |
対応しました. |
Comment by koichik [ 2007-10-30 ] |
SimpleWhere はシンプルなままの方がいいという意見もあるので or() および and(Where) は SimpleWhere から削除し,新たに ComplexWhere というクラスを追加します. |
Comment by koichik [ 2007-10-26 ] |
コメントのように修正しました. |
Comment by koichik [ 2007-10-26 ] |
SimpleWhere に and(Where) メソッドを追加して, where(new SimpleWhere() .eq("a", 1) .eq("b", 2) .and(new SimpleWhere().eq("c", 3).or().eq("d", 4)) .eq("f", 5)) のようにしてみようかと. a = ? and b = ? and (c =? or d = ?) and f = ? になるという具合. 少し流れが悪い気もするけど,あまり多用して欲しいものではないのでまぁいいのかな,と. |
Comment by koichik [ 2007-10-25 ] |
でもでも,これだと a=? and (b=? or c=?) みたいなのが表現できない... |
Comment by koichik [ 2007-10-25 ] |
上のコメントのように修正しました. |
Comment by higa [ 2007-10-25 ] |
thx. |
Comment by koichik [ 2007-10-25 ] |
http://d.hatena.ne.jp/higayasuo/20071025#1193319054 new Or(new SimpleWhere()...).or(new SimpleWhere()...) は流れないのでインタフェースを再考. new SimpleWhere().eq(...).or().eq(...)
にしてみます. |
Comment by koichik [ 2007-10-25 ] |
対応しました. Or クラスを追加しました.以下のように使えます. jdbcManager .from(Employee.class) .where(new Or(new SimpleWhere().eq("name", "foo")).or(new SimpleWhere().eq("name", "bar")) .getResultList(); クラス名が微妙かも.SimpleWhere と不揃いかも. |