Java 类org.hibernate.envers.RevisionNumber 实例源码

项目:spring-envers-audit    文件:ReflectionRevisionEntityInformation.java   
public ReflectionRevisionEntityInformation(Class<?> revisionEntityClass) {
    Assert.notNull(revisionEntityClass, "Revision entity class or type constructor parameter should not be null");

    AnnotationDetectionFieldCallback fieldCallback = new AnnotationDetectionFieldCallback(RevisionNumber.class);
    ReflectionUtils.doWithFields(revisionEntityClass, fieldCallback);

    this.revisionNumberType = fieldCallback.getType();
    this.revisionEntityClass = revisionEntityClass;
}
项目:spring-envers-audit    文件:DefaultRevisionAwareJpaRepository.java   
private RevisionMetadata<?> getRevisionMetadata(Object object) {
    if (object instanceof DefaultRevisionEntity) {
        return new DefaultRevisionMetadata((RevisionInfoEntity) object);
    } else {
        return new AnnotationRevisionMetadata<N>(object, RevisionNumber.class, RevisionTimestamp.class);
    }
}