Skip to content

Move RepositoryMethodContext to repository.core package #3175

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
odrotbohm opened this issue Oct 14, 2024 · 1 comment
Closed

Move RepositoryMethodContext to repository.core package #3175

odrotbohm opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels
in: repository Repositories abstraction type: enhancement A general enhancement

Comments

@odrotbohm
Copy link
Member

No description provided.

@odrotbohm odrotbohm added in: repository Repositories abstraction type: enhancement A general enhancement labels Oct 14, 2024
@odrotbohm odrotbohm self-assigned this Oct 14, 2024
odrotbohm added a commit that referenced this issue Oct 14, 2024
RepositoryMethodContext are now made available for dependency injection via RepositoryConfigurationExtensionSupport.registerBeansForRoot(…). Moved RMC into repository.core package (previously repository.core.support) and only expose factory methods on DefaultRepositoryMethodContext. DRMC also exposes a injection proxy lookup method that creates a proxy equipped with a TargetSource delegating to DRMC.getInstance() (previously ….getContext()). An additional, static DRMC.forMethod(…) allows the creation of a default instance for testing purposes.

Rename getRepository() to getMetadata() on RMC.

Fixes GH-3175.
@odrotbohm odrotbohm linked a pull request Oct 14, 2024 that will close this issue
@mp911de mp911de added this to the 3.4 RC1 (2024.1.0) milestone Oct 15, 2024
odrotbohm added a commit that referenced this issue Oct 15, 2024
RepositoryMethodContext are now made available for dependency injection via RepositoryConfigurationExtensionSupport.registerBeansForRoot(…). Moved RMC into repository.core package (previously repository.core.support) and only expose factory methods on DefaultRepositoryMethodContext. DRMC also exposes a injection proxy lookup method that creates a proxy equipped with a TargetSource delegating to DRMC.getInstance() (previously ….getContext()). An additional, static DRMC.forMethod(…) allows the creation of a default instance for testing purposes.

Rename getRepository() to getMetadata() on RMC.

Fixes GH-3175.
christophstrobl pushed a commit that referenced this issue Oct 15, 2024
RepositoryMethodContext are now made available for dependency injection via RepositoryConfigurationExtensionSupport.registerBeansForRoot(…). Moved RMC into repository.core package (previously repository.core.support) and only expose factory methods on DefaultRepositoryMethodContext. DRMC also exposes a injection proxy lookup method that creates a proxy equipped with a TargetSource delegating to DRMC.getInstance() (previously ….getContext()). An additional, static DRMC.forMethod(…) allows the creation of a default instance for testing purposes.

Rename getRepository() to getMetadata() on RMC.

Fixes GH-3175.
@mp911de mp911de changed the title Allow injection of RepositoryMethodContext Move RepositoryMethodContext to repository.core package Oct 16, 2024
@mp911de
Copy link
Member

mp911de commented Oct 16, 2024

After exploring the new programming model, we found that we deviate quite a bit from other user-facing code to obtain contextual details. Spring Data's code to interact with method-level annotations and contexts is quite commonly related to CrudMethodMetadata and friends. Before we add some user-facing programming models, we should explore CrudMethodMetadata to be user-facing a bit more to avoid introducing something we'd regret at a later stage.

mp911de pushed a commit that referenced this issue Oct 16, 2024
RepositoryMethodContext are now made available for dependency injection via RepositoryConfigurationExtensionSupport.registerBeansForRoot(…). Moved RMC into repository.core package (previously repository.core.support) and only expose factory methods on DefaultRepositoryMethodContext. DRMC also exposes a injection proxy lookup method that creates a proxy equipped with a TargetSource delegating to DRMC.getInstance() (previously ….getContext()). An additional, static DRMC.forMethod(…) allows the creation of a default instance for testing purposes.

Rename getRepository() to getMetadata() on RMC.

Fixes GH-3175.
mp911de pushed a commit that referenced this issue Oct 16, 2024
mp911de added a commit that referenced this issue Oct 16, 2024
Avoid nullability in RepositoryMethodContextHolder.getContext(). Introduce shortcut in RepositoryMethodContext to obtain the current thread-local context. Update documentation.

See #3175.
Original pull request: #3176
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
in: repository Repositories abstraction type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants