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.postgresql;
07:
08: import org.openrdf.sail.rdbms.evaluation.QueryBuilderFactory;
09: import org.openrdf.sail.rdbms.evaluation.SqlExprBuilder;
10: import org.openrdf.sail.rdbms.evaluation.SqlRegexBuilder;
11:
12: /**
13: * Overrides PostgreSQL specific SQL syntax. Including regular expression
14: * operator and CROSS JOIN notation.
15: *
16: * @author James Leigh
17: *
18: */
19: public class PgQueryBuilderFactory extends QueryBuilderFactory {
20:
21: @Override
22: public SqlRegexBuilder createSqlRegexBuilder(SqlExprBuilder where) {
23: return new SqlRegexBuilder(where, this ) {
24: @Override
25: protected void appendRegExp(SqlExprBuilder where) {
26: appendValue(where);
27: where.append(" ~ ");
28: appendPattern(where);
29: }
30: };
31: }
32: }
|