-
Notifications
You must be signed in to change notification settings - Fork 361
DATAJDBC-318 - Add support for Query Derivation #209
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
One major complaint: The select generation doesn't work properly for Entities that have 1:1 and 1:M relationships. Iseeker pointed this out in a comment on the issue all ready https://jira.spring.io/browse/DATAJDBC-318?focusedCommentId=188768&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-188768 208cee4 adds two quick tests to demonstrate the problem. The underlying problem is: We really shouldn't have two places where the base select gets constructed. |
e5964bc
to
b8d1fd3
Compare
Just using |
b3faf36
to
498ba98
Compare
Without this change we see cyclic dependencies between modules (i.e. subpackages). The following subpackages had a cycle: repository.query and repository.query.parser PartTreeJdbcQuery and JdbcQueryCreator(repository.query from jdbc) depend on PartTree (repository.query.parser) AbstractQueryCreator (repository.query.parser) depends on ParameterAccessor (repository.query from commons) This change changes the definition of a module, bundling all the modules above into one module (repository). Alternative changes that should fix the problem: 1. Move ParameterAccessor to a different (probably new package) 2. Move AbstractQueryCreator to a different (probably new package) 3. org.springframework.data.jdbc.repository.query to e.g. org.springframework.data.jdbc.repository.query.jdbc Original pull request: #209.
Move JdbcRepositoryQuery into repository.query package. Split JdbcRepositoryQuery into AbstractJdbcQuery and StringBasedJdbcQuery. Add QueryMapper for mapping of Criteria. Initial support for query derivation. Emit events and issue entity callbacks only for default RowMapper. Custom RowMapper/ResultSetExtractor are in full control of the mapping and can issue events/callbacks themselves. Update reference documentation. Original pull request: #209.
Added failing tests for entities with references. Code deduplication. Documentation wording. Formatting. Original pull request: #209.
We now reject criteria predicates for collections, maps and references. The select list selects all columns until DATAJDBC-523 is solved. Original pull request: #209.
The select list must include columns for 1:1 relationships. The implementation is copied from SqlGenerator and will be unified in the near future. Original pull request: #209.
498ba98
to
b02fdd9
Compare
Without this change we see cyclic dependencies between modules (i.e. subpackages). The following subpackages had a cycle: repository.query and repository.query.parser PartTreeJdbcQuery and JdbcQueryCreator(repository.query from jdbc) depend on PartTree (repository.query.parser) AbstractQueryCreator (repository.query.parser) depends on ParameterAccessor (repository.query from commons) This change changes the definition of a module, bundling all the modules above into one module (repository). Alternative changes that should fix the problem: 1. Move ParameterAccessor to a different (probably new package) 2. Move AbstractQueryCreator to a different (probably new package) 3. org.springframework.data.jdbc.repository.query to e.g. org.springframework.data.jdbc.repository.query.jdbc Original pull request: #209.
Move JdbcRepositoryQuery into repository.query package. Split JdbcRepositoryQuery into AbstractJdbcQuery and StringBasedJdbcQuery. Add QueryMapper for mapping of Criteria. Initial support for query derivation. Emit events and issue entity callbacks only for default RowMapper. Custom RowMapper/ResultSetExtractor are in full control of the mapping and can issue events/callbacks themselves. Update reference documentation. Original pull request: #209.
Added failing tests for entities with references. Code deduplication. Documentation wording. Formatting. Original pull request: #209.
We now reject criteria predicates for collections, maps and references. The select list selects all columns until DATAJDBC-523 is solved. Original pull request: #209.
The select list must include columns for 1:1 relationships. The implementation is copied from SqlGenerator and will be unified in the near future. Original pull request: #209.
Merged to master. |
The original extensions did not allow for executing fetch operations because they where on BindSpec. Original pull request: #210.
Update ticket reference in test. Original pull request: #210.
We now support query derivation for repository query methods. Query methods support a wide range of keywords including support for embedded entities. Query derivation is limited to properties that can be used in a
WHERE
clause without involving joins.Related ticket: DATAJDBC-318.