Skip to content

DATACMNS-1550 - Added RevisionType to RevisionMetadata. #399

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

Closed
wants to merge 2 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Jul 1, 2019

@odrotbohm
Copy link
Member

That's in place.

@odrotbohm odrotbohm closed this Jul 1, 2019
@SBylemans
Copy link

SBylemans commented Dec 20, 2019

Vote to reopen this as the constructor for the AnnotationRevisionMetadata object in the EnversRevisionRepositoryImpl hard codes the UNKNOWN type for the revision.

Code in EnversRevisionRepositoryImpl:

private RevisionMetadata<?> getRevisionMetadata(Object object) {
    return (RevisionMetadata)(object instanceof DefaultRevisionEntity 
        ? new DefaultRevisionMetadata((DefaultRevisionEntity)object) 
        : new AnnotationRevisionMetadata(object, RevisionNumber.class, RevisionTimestamp.class));
  }

This should become:

private RevisionMetadata<?> getRevisionMetadata(Object object) {
    return (RevisionMetadata)(object instanceof DefaultRevisionEntity 
    ? new DefaultRevisionMetadata((DefaultRevisionEntity)object) 
    : new AnnotationRevisionMetadata(object, RevisionNumber.class, RevisionTimestamp.class, object.getType()));
  }

NOTE the change is giving the type into the constructor.

I don't know whether it's possible to retrieve the type from the object, or from somewhere else....

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 this pull request may close these issues.

3 participants