01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.rdbms.evaluation;
07:
08: /**
09: * Prints round brackets in an SQL query.
10: *
11: * @author James Leigh
12: *
13: */
14: public class SqlBracketBuilder extends SqlExprBuilder {
15: private SqlExprBuilder where;
16: private String closing = ")";
17:
18: public SqlBracketBuilder(SqlExprBuilder where,
19: QueryBuilderFactory factory) {
20: super (factory);
21: this .where = where;
22: append("(");
23: }
24:
25: public String getClosing() {
26: return closing;
27: }
28:
29: public void setClosing(String closing) {
30: this .closing = closing;
31: }
32:
33: public SqlExprBuilder close() {
34: append(closing);
35: where.append(toSql());
36: where.addParameters(getParameters());
37: return where;
38: }
39: }
|