DATAREDIS-771 - Add support for IsTrue and IsFalse keywords in repository query methods.

We now support IsTrue and IsFalse keywords usage in repository query methods to create queries with predicates for boolean fields values without requiring to pass a boolean argument.

class Person {

    @Id String id;

    @Indexed Boolean alive;
}

interface PersonRepository extends Repository<Person, String> {

    Person findByAliveIsTrue();

    Person findByAliveIsFalse();
}

Original Pull Request: #342
This commit is contained in:
Mark Paluch
2018-05-15 15:14:55 +02:00
committed by Christoph Strobl
parent 127aa26f68
commit d73a0e1677
4 changed files with 56 additions and 0 deletions

View File

@@ -59,6 +59,12 @@ public class RedisQueryCreator extends AbstractQueryCreator<KeyValueQuery<RedisO
case SIMPLE_PROPERTY:
sink.sismember(part.getProperty().toDotPath(), iterator.next());
break;
case TRUE:
sink.sismember(part.getProperty().toDotPath(), true);
break;
case FALSE:
sink.sismember(part.getProperty().toDotPath(), false);
break;
case WITHIN:
case NEAR:
sink.near(getNearPath(part, iterator));