Skip to content

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

Closed
wants to merge 6 commits into from

Conversation

christophstrobl
Copy link
Member

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

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
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.
* @param probe The probe to use. Must not be {@literal null}.
*/
@SuppressWarnings("unchecked")
public Example(T probe) {
Copy link
Member

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.

@mp911de
Copy link
Member

mp911de commented Feb 29, 2016

Refactored Query by Example API to support typed and untyped ExampleSpec's.

Most significant changes for Spring Data JPA:
https://github.com/spring-projects/spring-data-jpa/pull/164/files#diff-b23bd4fdc1c19109c8f6830041fdc651R437

Test showing the usage related to inheritance:
https://github.com/spring-projects/spring-data-jpa/pull/164/files#diff-90a1e1093407b10052e14478211df4d4R1290

@mp911de mp911de force-pushed the issue/DATACMNS-810 branch from a81ef8d to 3a6011e Compare March 1, 2016 09:21
odrotbohm pushed a commit that referenced this pull request Mar 17, 2016
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.
odrotbohm pushed a commit that referenced this pull request Mar 17, 2016
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.
odrotbohm added a commit that referenced this pull request Mar 17, 2016
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.
@odrotbohm odrotbohm closed this Mar 17, 2016
@odrotbohm odrotbohm deleted the issue/DATACMNS-810 branch March 17, 2016 17:24
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
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
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants