Skip to content

Adopt to AOT changes in Commons #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

Open
wants to merge 2 commits into
base: 5.0.x
Choose a base branch
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
@Override
public RepositoryFragments contribute(RepositoryMetadata metadata,
CassandraEntityInformation<?, ?> entityInformation, CassandraOperations operations) {
return RepositoryFragments.empty();
Copy link
Author

Choose a reason for hiding this comment

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

Eventhough the fragment are empty by default for Cassandra, I chose to create a default impl that simple returned empty() to serve as a non-null fragmentsContributor default in the factory/factoryBeans as well as a placeholder in case we add default fragments (e.g. the MongoDB queryDsl fragments).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants