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

Promote Attribute called id when @Id is not present [DATACOUCH-533] #841

Closed
spring-projects-issues opened this issue May 7, 2020 · 1 comment
Assignees
Labels
type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 7, 2020

deniswsrosa opened DATACOUCH-533 and commented

According to MongoDB Documentation ( https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongodb-getting-started ), you can store an entity (Person in the example) without any mappings. If we try to do the same with our implementation, we will get a MappingException:

MappingException: An ID property is needed, but not found/could not be generated on this entity.

 It would be nice to pick the attribute “id” as the id of the document if no mapping is present. Here is the link about their documentation on how to deal with the Id: https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo-template.id-handling

 

 

 


Affects: 4.0 RC2 (Neumann)

Referenced from: pull request #241

Backported to: 4.0.2 (Neumann SR2)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 21, 2020

deniswsrosa commented

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants