Example usage for org.hibernate.envers AuditReader getRevisionNumberForDate

List of usage examples for org.hibernate.envers AuditReader getRevisionNumberForDate

Introduction

In this page you can find the example usage for org.hibernate.envers AuditReader getRevisionNumberForDate.

Prototype

Number getRevisionNumberForDate(Date date)
        throws IllegalStateException, RevisionDoesNotExistException, IllegalArgumentException;

Source Link

Document

Gets the revision number, that corresponds to the given date.

Usage

From source file:fi.vm.sade.eperusteet.utils.revision.impl.RevisionMetaServiceImpl.java

License:EUPL

@Override
public Number getCurrentRevision() {
    AuditReader reader = AuditReaderFactory.get(em);
    try {/*from  ww w.j  av  a  2 s.  co  m*/
        Number revision = reader.getRevisionNumberForDate(new Date(Long.MAX_VALUE));
        return revision;
    } catch (RevisionDoesNotExistException ex) {
    }
    return 0;
}