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

CreatedDate gets reset #41

Open
basejump opened this issue Oct 5, 2017 · 1 comment · May be fixed by #43
Open

CreatedDate gets reset #41

basejump opened this issue Oct 5, 2017 · 1 comment · May be fixed by #43
Assignees

Comments

@basejump
Copy link
Member

basejump commented Oct 5, 2017

see https://github.com/9ci/rcm/issues/3698
and fixed it by calling .attach() here
https://github.com/9ci/autocash/commit/4def15eb5de56fc6bf277cbce390f5c32d16732d

need to figure out whats going on and get this square away in this plugin

in AuditTrailHelper.initializeFields is calls isNewEntity
[8:50]
isNewEntity checks to see if its in the session. session.persistenceContext.getEntry(entity)
[8:50]
thats where the problem is

we can first check if it has a version and if its null then its new otherwise it exists

[9:28]
if there is no version then we have to rely on what is there and check the session with the assumption that its been attached

[9:28]
@snimavat make sense?

we could also just check the createdDate field and assume that if thats not null then its been initialized. it important to remeber that initializeFields is there mostly to help validation. AuditTrailInterceptor does it to when hibbernate saves it

@basejump
Copy link
Member Author

basejump commented May 9, 2019

@snimavat whats the deal with this and the open PR?

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

Successfully merging a pull request may close this issue.

2 participants