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

Ignore fields containing Optional.empty when performing Query by Example. #2401

Closed
wants to merge 2 commits into from

Conversation

gregturn
Copy link
Contributor

@gregturn gregturn commented Jan 7, 2022

No description provided.

Copy link
Contributor

@schauder schauder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the test independent of auditable? Because auditables are just a special case where this problem surfaces.

Also can we have some documentation for this?

@gregturn
Copy link
Contributor Author

Will do.

The Auditable interface introduces Optional getters, which when combined with Query by Example results in cryptic errors. By ignoring a probe's field that contains an Optional.empty, Query by Example works properly.

NOTE: This fix actually tests outside the originally detected scope of Auditable, verifying that ALL Optional.empty() fields are properly handled.

Closes #2176.
@gregturn
Copy link
Contributor Author

gregturn commented Feb 3, 2022

@schauder I've updated this PR with a non-Auditable based test class.

schauder pushed a commit that referenced this pull request Feb 4, 2022
The Auditable interface introduces Optional getters, which when combined with Query by Example results in cryptic errors. By ignoring a probe's field that contains an Optional.empty, Query by Example works properly.

NOTE: This fix actually tests outside the originally detected scope of Auditable, verifying that ALL Optional.empty() fields are properly handled.

Closes #2176
Original pull request #2401
schauder added a commit that referenced this pull request Feb 4, 2022
Removed Given/When/Then comments.
They are of limited use, especially since it is debatable what belongs in which section.

See #2176
Original pull request #2401
@schauder
Copy link
Contributor

schauder commented Feb 4, 2022

Thanks, that's merged.

@schauder schauder closed this Feb 4, 2022
@schauder schauder deleted the issue/GH-2176 branch February 4, 2022 12:56
schauder pushed a commit that referenced this pull request Feb 15, 2022
The Auditable interface introduces Optional getters, which when combined with Query by Example results in cryptic errors. By ignoring a probe's field that contains an Optional.empty, Query by Example works properly.

NOTE: This fix actually tests outside the originally detected scope of Auditable, verifying that ALL Optional.empty() fields are properly handled.

Closes #2176
Original pull request #2401
schauder added a commit that referenced this pull request Feb 15, 2022
Removed Given/When/Then comments.
They are of limited use, especially since it is debatable what belongs in which section.

See #2176
Original pull request #2401
AntonMolganov pushed a commit to AntonMolganov/spring-data-jpa that referenced this pull request Apr 14, 2022
The Auditable interface introduces Optional getters, which when combined with Query by Example results in cryptic errors. By ignoring a probe's field that contains an Optional.empty, Query by Example works properly.

NOTE: This fix actually tests outside the originally detected scope of Auditable, verifying that ALL Optional.empty() fields are properly handled.

Closes spring-projects#2176
Original pull request spring-projects#2401
AntonMolganov pushed a commit to AntonMolganov/spring-data-jpa that referenced this pull request Apr 14, 2022
Removed Given/When/Then comments.
They are of limited use, especially since it is debatable what belongs in which section.

See spring-projects#2176
Original pull request spring-projects#2401
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

Successfully merging this pull request may close these issues.

None yet

2 participants