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: import org.openrdf.sail.rdbms.RdbmsValueFactory;
09:
10: /**
11: * Creates the SQL query building components.
12: *
13: * @author James Leigh
14: *
15: */
16: public class QueryBuilderFactory {
17: private RdbmsValueFactory vf;
18: private boolean usingHashTable;
19:
20: public void setValueFactory(RdbmsValueFactory vf) {
21: this .vf = vf;
22: }
23:
24: public void setUsingHashTable(boolean b) {
25: this .usingHashTable = b;
26: }
27:
28: public QueryBuilder createQueryBuilder() {
29: QueryBuilder query = new QueryBuilder(createSqlQueryBuilder());
30: query.setValueFactory(vf);
31: query.setUsingHashTable(usingHashTable);
32: return query;
33: }
34:
35: public SqlQueryBuilder createSqlQueryBuilder() {
36: return new SqlQueryBuilder(this );
37: }
38:
39: public SqlExprBuilder createSqlExprBuilder() {
40: return new SqlExprBuilder(this );
41: }
42:
43: public SqlRegexBuilder createSqlRegexBuilder(SqlExprBuilder where) {
44: return new SqlRegexBuilder(where, this );
45: }
46:
47: public SqlBracketBuilder createSqlBracketBuilder(
48: SqlExprBuilder where) {
49: return new SqlBracketBuilder(where, this );
50: }
51:
52: public SqlJoinBuilder createSqlJoinBuilder(String table,
53: String alias) {
54: return new SqlJoinBuilder(table, alias, this);
55: }
56: }
|