Skip to content

Explicitly reject unsupported StringMatcher modes when executing examples [DATAJPA-944] #1295

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

Closed
spring-projects-issues opened this issue Aug 5, 2016 · 8 comments
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug

Comments

@spring-projects-issues
Copy link

Oleg Sergeev opened DATAJPA-944 and commented

Official documentation for Spring Data JPA describes all supported StringMatchers including REGEX matcher http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example

But when I'm using REGEX matcher I get an error which says that such matcher is not supported. I've checked QueryByExamplePredicateBuilder.class and found that REGEX support is not implemented.
Log attached


Affects: 1.10.2 (Hopper SR2)

Attachments:

0 votes, 5 watchers

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

The Criteria API doesn't support regular expressions as not all relational databases offer this feature. I skimmed through the reference documentation but couldn't find any references to us claiming we'd support that. Where exactly did you find that hint?

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

Nevermind, I think I got you. The ExampleMatcher API contained in Spring Data Commons of course contains StringMatcher.REGEX as other stores (e.g. MongoDB) support it. We should explicitly reject that particular matcher in JPA

@spring-projects-issues
Copy link
Author

Oleg Sergeev commented

Got it, thank you very much! I didn't consider that some databases do not offer this feature

@spring-projects-issues
Copy link
Author

Jens Schauder commented

We should check if we can reject unsupported matchers any earlier than we do now

@spring-projects-issues
Copy link
Author

Jens Schauder commented

We do reject the matcher as soon as one tries to use it.

The only way to reject it earlier would be to make store specific Example classes.
I don't think we want to do that

@spring-projects-issues
Copy link
Author

Jens Schauder commented

Batch closing resolved issue without a fix version and a resolution indicating that there is nothing to release (Won't fix, Invalid ...)

@spring-projects-issues
Copy link
Author

noxsicarius commented

Please fix the documentation for this. I spent entirely far too long trying to figure out why regex option was not working with StringMatcher. I spent a lot of time scouring the web until I came across this ticket stating it's not supported. Your documentation still states this item is supported, which is what had me floundering for so long.

Exact quote from spring documentation:
Only supports starts/contains/ends/regex matching for strings and exact matching for other property types.

@spring-projects-issues
Copy link
Author

Jens Schauder commented

noxsicarius Please create a new issue, since this one is already closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants