Skip to content

Don't create PersistentEntity for Nullable wrapper type. #2394

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

Conversation

christophstrobl
Copy link
Member

@christophstrobl christophstrobl commented Jun 25, 2021

Detect a nullable wrapper type (like java.util.Optional) and avoid creating an entity for it.
Also updates entity detection for properties that nest the target type deep within the generic structure as well as map key types.

delivers-input-to: spring-projects/spring-data-mongodb#3656

Tested against Modules for: JPA, MongoDB, Redis

@christophstrobl christophstrobl marked this pull request as ready for review July 2, 2021 11:52
@mp911de mp911de self-assigned this Jul 8, 2021
@mp911de mp911de added the type: enhancement A general enhancement label Jul 8, 2021
@mp911de mp911de added this to the 2.6 M1 (2021.1.0) milestone Jul 8, 2021
mp911de pushed a commit that referenced this pull request Jul 8, 2021
mp911de pushed a commit that referenced this pull request Jul 8, 2021
mp911de added a commit that referenced this pull request Jul 8, 2021
Reduce TypeDiscoverer.isNullableWrapper method visibility to private to avoid exposure in preparation for wider value type support.

Original pull request: #2394.
See #2390.
@mp911de
Copy link
Member

mp911de commented Jul 8, 2021

That's merged and polished now.

@mp911de mp911de closed this Jul 8, 2021
@mp911de mp911de deleted the issue/2390 branch July 8, 2021 09:51
mp911de pushed a commit that referenced this pull request Feb 21, 2022
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.

MappingContext should not consider java.util.Optional an entity type
2 participants