Skip to content

Commit

Permalink
SHIBUI-1262(1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Jun 5, 2019
1 parent 3610ed1 commit f5eae5e
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.DefaultRevisionEntity;
import org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity;
import org.hibernate.envers.RevisionEntity;

import javax.persistence.Entity;
Expand All @@ -14,7 +15,7 @@
@RevisionEntity(PrincipalEnhancingRevisionListener.class)
@Getter
@Setter
public class PrincipalAwareRevisionEntity extends DefaultRevisionEntity {
public class PrincipalAwareRevisionEntity extends DefaultTrackingModifiedEntitiesRevisionEntity {

private String principalUserName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -120,6 +121,10 @@ private EntityDescriptor buildDescriptorFromRepresentation(final EntityDescripto
setupLogout(ed, representation);
setupRelyingPartyOverrides(ed, representation);

//Let envers recognize update revision type for EntityDescriptor type
//when modifying Attributes and SPSSODescriptor inside RoleDescriptors collection
ed.setModifiedDate(LocalDateTime.now());

return ed;
}

Expand Down
Loading

0 comments on commit f5eae5e

Please sign in to comment.