From 3e9066efc94200219051b6abc7a5019a4209f7d6 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 21 Oct 2007 15:53:37 +0000 Subject: Support closed filter in generated SQL. --- .../java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/com/amazon') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java index d463283..855cce4 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java @@ -45,6 +45,7 @@ import com.amazon.carbonado.Transaction; import com.amazon.carbonado.Trigger; import com.amazon.carbonado.capability.IndexInfo; import com.amazon.carbonado.filter.AndFilter; +import com.amazon.carbonado.filter.ClosedFilter; import com.amazon.carbonado.filter.ExistsFilter; import com.amazon.carbonado.filter.Filter; import com.amazon.carbonado.filter.FilterValues; @@ -1059,6 +1060,7 @@ class JDBCStorage extends StandardQueryFactory * @throws UndeclaredThrowableException wraps a RepositoryException * since RepositoryException cannot be thrown directly */ + @Override public Object visit(PropertyFilter filter, Object param) { try { visit(filter); @@ -1077,6 +1079,7 @@ class JDBCStorage extends StandardQueryFactory * @throws UndeclaredThrowableException wraps a RepositoryException * since RepositoryException cannot be thrown directly */ + @Override public Object visit(ExistsFilter filter, Object param) { try { visit(filter); @@ -1207,6 +1210,7 @@ class JDBCStorage extends StandardQueryFactory return array; } + @Override public FetchException visit(OrFilter filter, Object param) { FetchException e; mStatementBuilder.append('('); @@ -1223,6 +1227,7 @@ class JDBCStorage extends StandardQueryFactory return null; } + @Override public FetchException visit(AndFilter filter, Object param) { FetchException e; mStatementBuilder.append('('); @@ -1239,6 +1244,7 @@ class JDBCStorage extends StandardQueryFactory return null; } + @Override public FetchException visit(PropertyFilter filter, Object param) { try { mStatementBuilder.appendColumn(mJoinNode, filter.getChainedProperty()); @@ -1279,6 +1285,7 @@ class JDBCStorage extends StandardQueryFactory return null; } + @Override public FetchException visit(ExistsFilter filter, Object param) { if (filter.isNotExists()) { mStatementBuilder.append("NOT "); @@ -1347,6 +1354,12 @@ class JDBCStorage extends StandardQueryFactory return null; } + @Override + public FetchException visit(ClosedFilter filter, Object param) { + mStatementBuilder.append("1=0"); + return null; + } + private void addBindParameter(PropertyFilter filter) { RelOp op = filter.getOperator(); StorableProperty property = filter.getChainedProperty().getLastProperty(); -- cgit v1.2.3