Skip to content

QueryMapper fails when using Criteria.from(…) with two or more criteria #383

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
peacetrue opened this issue Jun 6, 2020 · 2 comments
Closed
Labels
type: bug A general bug

Comments

@peacetrue
Copy link

 Can I use Criteria.from like this:

image

@mp911de mp911de added the type: bug A general bug label Jun 9, 2020
@mp911de mp911de changed the title Combinator INITIAL not supported Mapping Criteria.from(…) with two or more element fails Jun 9, 2020
@mp911de mp911de added this to the 1.1.1 (Neumann SR1) milestone Jun 9, 2020
@mp911de
Copy link
Member

mp911de commented Jun 9, 2020

Please refrain from pasting images into bug reports. Those cannot be indexed.

The actual code causing the issue is the usage of Criterial.from(…) when used with two or more elements.

Criteria criteria = Criteria.from(Criteria.where("name").is("Foo"), Criteria.where("name").is("Bar") //
						.or("age").lessThan(49));

@mp911de mp911de changed the title Mapping Criteria.from(…) with two or more element fails QueryMapper fails when using Criteria.from(…) with two or more criteria Jun 9, 2020
mp911de added a commit that referenced this issue Jun 9, 2020
…teria.

Using Criteria.from(…) with multiple Criteria objects now uses properly AND combination along with group nesting to render a correct criteria. Previously, the INITIAL combinator in groups caused a mapping exception.
mp911de added a commit that referenced this issue Jun 9, 2020
Use more concise assertions.
mp911de added a commit that referenced this issue Jun 9, 2020
…teria.

Using Criteria.from(…) with multiple Criteria objects now uses properly AND combination along with group nesting to render a correct criteria. Previously, the INITIAL combinator in groups caused a mapping exception.
mp911de added a commit that referenced this issue Jun 9, 2020
Use more concise assertions.
@mp911de
Copy link
Member

mp911de commented Jun 9, 2020

That's fixed and backported now.

@mp911de mp911de closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants