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

Failed in bidirectional mapping when one of the audit fields gets updated. #41

Closed
anz000 opened this issue Apr 12, 2019 · 2 comments
Closed
Labels
invalid This doesn't seem right

Comments

@anz000
Copy link

anz000 commented Apr 12, 2019

I have manyToOne and oneToMany relationship like

class A {
...
@OneToMany
List<B> b;
@LastModifiedDate
private LocalDateTime lastModifiedDate;
}
class B {
...
@ManyToOne
A a;
}

This fails because the auditing field lastModifiedDate, gets updated (I think) and the save method fails. removing the auditing field works fine.
org.springframework.data.mapping.MappingException: Cannot lookup property @io.github.kaiso.relmongo.annotation.ManyToOne(mappedBy=gists, fetch=LAZY)private com.timecloud.source.entity.pojo.ClassA com.timecloud.gist.entity.ClassB.source on null intermediate! Original path was: source.lastModifiedDate on com.timecloud.gist.entity.ClassB.

@kaiso
Copy link
Owner

kaiso commented Apr 26, 2019

can you paste here more details on your code and if possible your pom.xml to see the dependencies you are using. also the full stacktrace please.

@kaiso
Copy link
Owner

kaiso commented May 15, 2019

Sorry I will close this issue, I'm able to use auditing annotations without any problem, please take a look at relmongo tests to see an example on that.

@kaiso kaiso closed this as completed May 15, 2019
@kaiso kaiso added the invalid This doesn't seem right label May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants