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

Shadows don't represent a complete view #568

Closed
mdii opened this issue Jul 17, 2017 · 3 comments
Closed

Shadows don't represent a complete view #568

mdii opened this issue Jul 17, 2017 · 3 comments
Labels

Comments

@mdii
Copy link
Contributor

@mdii mdii commented Jul 17, 2017

Hello,
I was recently playing with querying shadows. I find it a great and useful feature, however I noticed that when I query for a rather complex object the historical view is not fully returned.

I have an entity X that has a many-to-one relationship with entity Y.
Ys are created and updated independently of Xs, so when an X is updated no snapshot is created for its Y. Now when I query for shadows of X, the value of its Y is null. I believe in this case, the shadow query should look for the last snapshot of Y that precedes the snapshot of X.

I am not sure how exactly shadow creation works, but it seems that it searches the object graph in the same commit.

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Jul 17, 2017

Hi, good question. In fact, Shadows query can return incomplete graph, when some Entity not exists in any commit in your query scope (assuming that you are using COMMIT_DEPTH).
I think we should create the third, broader query scope, lets say FULL_DEPTH.

When using this scope, JaVers would load latest Shadow of the missing Entity. It would give you full graph but you pay in extra db queries.

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Jul 21, 2017

I'm going to develop this as the next feature in javers

bartoszwalacik added a commit that referenced this issue Jul 25, 2017
bartoszwalacik added a commit that referenced this issue Jul 25, 2017
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Jul 30, 2017

fixed in 3.5.0
New scope: commit-deep+
see https://javers.org/documentation/jql-examples/#shadow-scopes

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

Successfully merging a pull request may close this issue.

None yet
2 participants