Skip to content

Add support for RepositoryFragmentsContributor #1574

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 4 commits into from

Conversation

onobc
Copy link

@onobc onobc commented May 8, 2025

This code proposal adopts the newly added AOT changes (spring-data-commons/3282) to Cassandra repositories.

Note

While the AOT repositories support has not been added yet, I think it still makes sense to add these changes in as they will be required by AOT and this is a small enough change to focus on in a single PR.

  • Introduces repository fragments contributor and updates the repository factories and factory beans w/ to use the default implementations.

  • Also makes the CassandraRepositoryFactoryBean consistent with its reactive counterpart by only setting the mapping context from the CassandraOperations in afterPropertiesSet iff the mapping context was not specified by the user.

See: #1566

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@onobc onobc requested review from mp911de and christophstrobl May 8, 2025 23:03
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 8, 2025
This change adopts the newly added AOT changes from spring-projects/spring-data-commons#3282 to Cassandra repositories.

- Introduces repository fragments contributor and updates the repository factories and factory beans w/ to use the default implementations.

- Also makes the `CassandraRepositoryFactoryBean` consistent with its reactive counterpart by only setting the mapping context from the `CassandraOperations` in `afterPropertiesSet` iff the mapping context was not specified by the user.

See: spring-projects#1566
@onobc onobc force-pushed the issue/GH-1566 branch from 9986abd to 84d09ac Compare May 8, 2025 23:09
Copy link
Member

@mp911de mp911de left a comment

Choose a reason for hiding this comment

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

Great start, left two comments about visibility.

Moves default fragment contributors into their own file and sets their visiblity to package-protected.
* @author Chris Bono
* @since 5.0
*/
enum DefaultCassandraRepositoryFragmentsContributor implements CassandraRepositoryFragmentsContributor {
Copy link
Author

Choose a reason for hiding this comment

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

Question on naming of "default impls".... what is our team standard on this? I have seen so far quite a bit of Foo -> FooSupport rather than Foo -> DefaultFoo. I am happy to rename.

Copy link
Member

Choose a reason for hiding this comment

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

Mostly, SimpleFoo or DefaultFoo. In JPA and MongoDB I went for QuerydslContributor because the name is already quite long. How about EmptyContributor for Cassandra?

Copy link
Author

Choose a reason for hiding this comment

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

Yeh, I like EmptyContributor. I will adjust.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@onobc onobc requested a review from mp911de May 9, 2025 14:08
Shorten name of default fragment contributors to `EmptyFragmentsContributor` and `ReactiveEmptyFragmentsContributor`.
@mp911de mp911de self-assigned this May 12, 2025
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 12, 2025
@mp911de mp911de added this to the 5.0 M3 (2025.1.0) milestone May 12, 2025
@mp911de mp911de changed the title Adopt to AOT changes in Commons Add support for RepositoryFragmentsContributor May 13, 2025
mp911de pushed a commit that referenced this pull request May 13, 2025
This change adopts the newly added AOT changes from spring-projects/spring-data-commons#3282 to Cassandra repositories.

- Introduces repository fragments contributor and updates the repository factories and factory beans w/ to use the default implementations.

- Also makes the `CassandraRepositoryFactoryBean` consistent with its reactive counterpart by only setting the mapping context from the `CassandraOperations` in `afterPropertiesSet` iff the mapping context was not specified by the user.

Closes #1574
mp911de added a commit that referenced this pull request May 13, 2025
Adopt to deprecations in Commons.

See #1574
@mp911de
Copy link
Member

mp911de commented May 13, 2025

Thank you for your contribution. That's merged and polished now.

@mp911de mp911de closed this May 13, 2025
@onobc onobc deleted the issue/GH-1566 branch May 13, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants