Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsTrue and IsFalse Query Method Support for Boolean Attributes [DATAREDIS-771] #1310

Closed
spring-projects-issues opened this issue Feb 12, 2018 · 1 comment
Assignees
Labels
in: repository type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 12, 2018

Luke Shannon opened DATAREDIS-771 and commented

I have an POJO that looks like this:

@Data
@NoArgsConstructor
@AllArgsConstructor
@RedisHash("activity")
public class Activity {
	
	@Id
	private String ip;
...most fields omitted for brevity
	private Boolean blocked;	
	
}

I want to just get the references that have a True value for the blocked attrribute.

The access method I'm trying in my Repository looks like this:

// Some comments here
	List<Activity> findByBlockedTrue();

However, when my Boot app (1.5.6.RELEASE) starts I get this error:

java.lang.IllegalArgumentException: TRUE (0): [IsTrue, True]is not supported for redis query derivation

It looks like the RedisQueryCreator is only using NEAR and SIMPLE_PROPERTY, which do not handle TRUE/FALSE:
https://github.com/spring-projects/spring-data-commons/blob/master/src/main/java/org/springframework/data/repository/query/parser/Part.java

Is this a limitation of the Redis access patterns or could this be added to Repository support?

Thanks!


Affects: 2.0.3 (Kay SR3)

Referenced from: pull request #342

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 15, 2018

Mark Paluch commented

These keywords were just not supported. Adding these is a nice little feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants