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

Auditor attempts to set lastModifiedDate on null object [DATACMNS-1669] #2089

Closed
spring-projects-issues opened this issue Feb 18, 2020 · 1 comment
Assignees
Labels
in: mapping status: duplicate type: bug

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Feb 18, 2020

Blake opened DATACMNS-1669 and commented

The same example given in https://jira.spring.io/browse/DATACMNS-1461 for @CreatedDate is still an issue for @LastModifiedDate:

Given two classes where ClassB contains @LastModifiedDate property and is referenced by ClassA:

@Document(collection = "ClassA")
public class ClassA
{ 
    @Id 
    private String id; 

    private ClassB other; 
}

public class ClassB
{ 
    @CreatedDate 
    private Instant created; 

    @LastModifiedDate
    private Instant modified; 
}

An attempt to store an instance of ClassA when other is null fails with a MappingException:

org.springframework.data.mapping.MappingException: Cannot lookup property private ClassB ClassA.other on null intermediate! Original path was: other.created on ClassA.

Given @CreatedDate was fixed it, seems @LastModifiedDate should also be fixed since it is common to track both a created and modified date


Affects: 2.1.15 (Lovelace SR15), 2.2.4 (Moore SR4), 2.3 M3 (Neumann)

Reference URL: https://jira.spring.io/browse/DATACMNS-1461

Issue Links:

  • DATACMNS-1671 Auditor attempts to set created date on null object
    ("duplicates")
@spring-projects-issues
Copy link
Author

spring-projects-issues commented Feb 24, 2020

Mark Paluch commented

Closing this ticket as a duplicate of DATACMNS-1671

@spring-projects-issues spring-projects-issues added type: bug status: duplicate in: mapping labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mapping status: duplicate type: bug
Projects
None yet
Development

No branches or pull requests

2 participants