-
Notifications
You must be signed in to change notification settings - Fork 682
DATACMNS-810 - Add core types for Query By Example support. #153
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
Conversation
Prepare issue branch.
Added required types for Query By Example which should be used by the individual store implementations. Generally the Example type captures a sample object and allow various settings concerning the mapping into an actual query. So there’s configuration options for handling null values, string matching, property paths to ignore,... ---- Required to build: DATAJPA-218, DATAMONGO-1245
592a67b
to
e130069
Compare
Split Example and ExampleSpec to create reusable components. Refactor builder pattern to a fluent API that creates immutable instances. Split user and framework API, Example and ExampleSpec are user API, created ExampleSpecAccessor for modules to access example spec configuration. Create static methods in GenericPropertyMatchers to ease creation of matchers in a readable style. Convert PropertySpecifier to inner class and move PropertySpecifiers to ExampleSpec.
e130069
to
ca2224a
Compare
ca2224a
to
f6007ec
Compare
* @param probe The probe to use. Must not be {@literal null}. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
public Example(T probe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make private to make sure of(…)
is the only way to create instances of Example
.
Refactored Query by Example API to support typed and untyped ExampleSpec's. Most significant changes for Spring Data JPA: Test showing the usage related to inheritance: |
a81ef8d
to
3a6011e
Compare
Added required types for Query by Example which should be used by the individual store implementations. Generally the Example type captures a sample object and allow various settings concerning the mapping into an actual query. So there’s configuration options for handling null values, string matching, property paths to ignore, Related tickets: DATAJPA-218, DATAMONGO-1245. Original pull request: #153.
Split Example and ExampleSpec to create reusable components. Refactor builder pattern to a fluent API that creates immutable instances. Split user and framework API, Example and ExampleSpec are user API, created ExampleSpecAccessor for modules to access example spec configuration. Create static methods in GenericPropertyMatchers to ease creation of matchers in a readable style. Convert PropertySpecifier to inner class and move PropertySpecifiers to ExampleSpec. Related tickets: DATAJPA-218, DATAMONGO-1245. Original pull request: #153.
Renamed ExampleSpecification to ExampleMatcher and introduced a matching() factory method, dropping the dedicated override mechanism for types for now. Updated documentation accordingly. Used Lombok for constructor creation, field defaults, toString() as well as equals(…) and hashCode() implementations. Tweaked imports in unit tests. Renamed methods to express expected behavior. Original pull request: #153.
Only one neds to be created, and once it is in place in the hierarchy it should be usable by all the child contexts that get added. Fixes spring-projectsgh-153
The fix for spring-projectsgh-153 was sensible, but has now exposed another issue which is that the bootstrap initializers, whilst they are now only created once, actually only get applied to the parent context in a hierarchy. Most of the time this doesn't matter because the child contexts all benefit from environment changes and additional beans added to the parent. If the children are supposed to actually have different environments, though, there is a problem. So this change locates the existing bootstrap context and applies it to each new context created separately. Unfortunately we have to use reflection to do that for now because there is no way to discover the parent with a public API before the context is refreshed. See spring-projectsgh-190
Added required types for Query By Example which should be used by the individual store implementations.
Generally the
Example
captures a sample object and allow various settings concerning the mapping into an actual query. So there’s configuration options for handling null values, string matching, property paths to ignore,...Required by: DATAJPA-218, DATAMONGO-1245