diff --git a/jans-orm/couchbase-sample/src/main/java/io/jans/orm/couchbase/CouchbaseSample.java b/jans-orm/couchbase-sample/src/main/java/io/jans/orm/couchbase/CouchbaseSample.java index f0fd71fff0f..f03fde4692a 100644 --- a/jans-orm/couchbase-sample/src/main/java/io/jans/orm/couchbase/CouchbaseSample.java +++ b/jans-orm/couchbase-sample/src/main/java/io/jans/orm/couchbase/CouchbaseSample.java @@ -49,6 +49,22 @@ public static void main(String[] args) { newUser.getCustomAttributes().add(new CustomObjectAttribute("test", "test_value")); couchbaseEntryManager.persist(newUser); + // Find all with lower and or filters + Filter orFilterWithLower = Filter.createORFilter(Filter.createEqualityFilter(Filter.createLowercaseFilter("description"), "test1"), + Filter.createEqualityFilter(Filter.createLowercaseFilter("description"), "test2")); + List usersWithOrFilter = couchbaseEntryManager.findEntries("ou=sessions,o=gluu", SimpleUser.class, orFilterWithLower); + for (SimpleUser user : usersWithOrFilter) { + LOG.info("User with uid: '{}' with DN: '{}'", user.getUserId(), user.getDn()); + } + + // Find all with lower and or filters + Filter orFilterWithLower2 = Filter.createORFilter(Filter.createSubstringFilter(Filter.createLowercaseFilter("description"), null, new String[] { "test1" }, null), + Filter.createSubstringFilter(Filter.createLowercaseFilter("displayName"), null, new String[] { "test1" }, null)); + List usersWithOrFilter2 = couchbaseEntryManager.findEntries("ou=sessions,o=gluu", SimpleUser.class, orFilterWithLower2); + for (SimpleUser user : usersWithOrFilter2) { + LOG.info("User with uid: '{}' with DN: '{}'", user.getUserId(), user.getDn()); + } + // Find all users which have specified object classes defined in SimpleUser List users = couchbaseEntryManager.findEntries("ou=people,o=jans", SimpleUser.class, null); for (SimpleUser user : users) { diff --git a/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java b/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java index 8e81fe82603..a202f427df5 100644 --- a/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java +++ b/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java @@ -102,7 +102,7 @@ public ConvertedExpression convertToCouchbaseFilter(Filter genericFilter, Map