From 78451de173aba056c2141ae5357d5df69902a150 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Wed, 27 Mar 2013 19:09:15 -0700 Subject: [PATCH] CSPACE-5943: Added comments, pseudocode for adding an inAuthority restriction to the SQL query. --- .../client/java/RepositoryJavaClientImpl.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java index 64f90839e..a4be744c9 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java @@ -936,6 +936,25 @@ public class RepositoryJavaClientImpl implements RepositoryClient 'deleted') "; + + // FIXME: Need to add a WHERE clause restriction on inAuthority + + // FIXME: Need to handle the '_ALL_' case for inAuthority by removing + // that restriction (see AuthorityResource.getAuthorityItemList()) + +/* + Pseudo-code-like continuation + String inAuthority = handler.getJDBCQueryParams().get(IN_AUTHORITY_PARAM); + if (Tools.notBlank(inAuthority) { + if (!inAuthority.equals.(AuthorityResource.PARENT_WILDCARD)) { + sql = sql + " AND (commonschema.inauthority = '" + handler.getInAuthorityValue() + "') "; + } + } +*/ + + // FIXME: We might also consider skipping the JOIN on the common schema table + // in the '_ALL_' case, where we are not restricting by inAuthority value + PreparedStatementBuilder jdbcFilterBuilder = new PreparedStatementBuilder(sql){ @Override protected void preparePrepared(PreparedStatement preparedStatement) -- 2.47.3