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: * Facilitates the creation of a CASE expression in SQL.
10: *
11: * @author James Leigh
12: *
13: */
14: public class SqlCaseBuilder {
15: private SqlExprBuilder where;
16:
17: public SqlCaseBuilder(SqlExprBuilder where) {
18: super ();
19: this .where = where;
20: where.append("CASE ");
21: }
22:
23: public SqlExprBuilder when() {
24: where.append(" WHEN ");
25: return where;
26: }
27:
28: public SqlExprBuilder then() {
29: where.append(" THEN ");
30: return where;
31: }
32:
33: public SqlExprBuilder end() {
34: where.append(" END");
35: return where;
36: }
37: }
|