Skip to content
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

Constructor creation using @DocumentReference SpEL referring to self in fails #4484

Closed
joeshadbolt opened this issue Aug 24, 2023 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@joeshadbolt
Copy link

joeshadbolt commented Aug 24, 2023

Hi!

I am trying to use the @DocumentReference annotation as per guidance on modelling a One-To-Many relationship in the reference documentation:
https://docs.spring.io/spring-data/mongodb/docs/3.3.6/reference/html/#mapping-usage.document-references

However we are experiencing the following exception:
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field '_id' cannot be found on null

Sample repository re-creating the issue:
https://github.com/joeshadbolt/spring-data-mongodb

Many thanks!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 24, 2023
@dcebotarenco
Copy link

Had an attempt here:
joeshadbolt/spring-data-mongodb#1

Have a look if it works for you

@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 28, 2023
sxhinzvc added a commit that referenced this issue Aug 28, 2023
This commit enables a source entity with a one-to-many @DocumentReference lookup property to be instantiated properly when the referenced entity - which contains the linking value - is used as a constructor argument.

See #4484
@mp911de mp911de changed the title modelling relational style One-To-Many with @DocumentReference Constructor creation using @DocumentReference SpEL referring to self in fails Aug 29, 2023
sxhinzvc added a commit that referenced this issue Aug 29, 2023
This commit enables document reference lookup to use `DocumentReferenceSource` to properly instantiate an entity containig a @DocumentReference `#self` property.

Closes #4484
christophstrobl pushed a commit that referenced this issue Aug 31, 2023
This commit enables document reference lookup to use `DocumentReferenceSource` to properly instantiate an entity containig a @DocumentReference `#self` property.

Closes #4484
Original Pull Request: #4486
christophstrobl pushed a commit that referenced this issue Aug 31, 2023
This commit enables document reference lookup to use `DocumentReferenceSource` to properly instantiate an entity containig a @DocumentReference `#self` property.

Closes #4484
Original Pull Request: #4486
@christophstrobl christophstrobl added this to the 4.0.10 (2022.0.10) milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
6 participants