01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: WhereGroupOr.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.database.queries;
09:
10: import com.uwyn.rife.database.Datasource;
11: import com.uwyn.rife.database.capabilities.Capabilities;
12:
13: public class WhereGroupOr<ParentType extends WhereQuery> extends
14: AbstractWhereGroup<ParentType> {
15: public WhereGroupOr(Datasource datasource, WhereQuery parent) {
16: super (datasource, parent);
17: }
18:
19: public Capabilities getCapabilities() {
20: return null;
21: }
22:
23: public ParentType end() {
24: StringBuilder where = new StringBuilder();
25:
26: where.append("(");
27: where.append(getSql());
28: where.append(")");
29:
30: mParent.whereOr(where.toString());
31:
32: mParent.addWhereParameters(getWhereParameters());
33:
34: return (ParentType) mParent;
35: }
36: }
|