Class AuditEventDaoImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractDao<AuditEvent>
-
- ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventDaoImpl
-
- All Implemented Interfaces:
BaseDao<AuditEvent>
,AuditEventDao
@Repository public class AuditEventDaoImpl extends AbstractDao<AuditEvent> implements AuditEventDao
- Author:
- pavlidis
- See Also:
AuditEvent
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractDao
log
-
-
Constructor Summary
Constructors Constructor Description AuditEventDaoImpl(SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Auditable>
Map<T,AuditEvent>getCreateEvents(Collection<T> auditables)
Obtain the creation events for the given auditables.List<AuditEvent>
getEvents(Auditable auditable)
Obtain the audit events associated to a given auditable.AuditEvent
getLastEvent(Auditable auditable)
Obtain the latest event for a given auditable.AuditEvent
getLastEvent(Auditable auditable, Class<? extends AuditEventType> type)
Obtain the latest event of a given type for a given auditable.AuditEvent
getLastEvent(Auditable auditable, Class<? extends AuditEventType> type, Collection<Class<? extends AuditEventType>> excludedTypes)
Obtain the latest event of a given type, excluding a certain number of types.<T extends Auditable>
Map<T,AuditEvent>getLastEvents(Class<T> auditableClass, Class<? extends AuditEventType> type)
Obtain the latest events of a specified type for all auditable of a given type.<T extends Auditable>
Map<T,AuditEvent>getLastEvents(Collection<T> auditables, Class<? extends AuditEventType> type)
Obtain the latest events of a specified type for all given auditables.<T extends Auditable>
Collection<T>getNewSinceDate(Class<T> auditableClass, Date date)
Get auditables that have been created since the given date.<T extends Auditable>
Collection<T>getUpdatedSinceDate(Class<T> auditableClass, Date date)
Get auditables that have been updated since the given date.-
Methods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, create, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, streamQuery, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, create, find, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, remove, save, save, streamAll, streamAll, update, update
-
-
-
-
Constructor Detail
-
AuditEventDaoImpl
@Autowired public AuditEventDaoImpl(SessionFactory sessionFactory)
-
-
Method Detail
-
getEvents
public List<AuditEvent> getEvents(Auditable auditable)
Description copied from interface:AuditEventDao
Obtain the audit events associated to a given auditable.Events are sorted by date in ascending order.
- Specified by:
getEvents
in interfaceAuditEventDao
-
getLastEvent
@Nullable public AuditEvent getLastEvent(Auditable auditable)
Description copied from interface:AuditEventDao
Obtain the latest event for a given auditable.- Specified by:
getLastEvent
in interfaceAuditEventDao
-
getLastEvent
public AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type)
Description copied from interface:AuditEventDao
Obtain the latest event of a given type for a given auditable.- Specified by:
getLastEvent
in interfaceAuditEventDao
-
getLastEvent
public AuditEvent getLastEvent(Auditable auditable, Class<? extends AuditEventType> type, Collection<Class<? extends AuditEventType>> excludedTypes)
Description copied from interface:AuditEventDao
Obtain the latest event of a given type, excluding a certain number of types.- Specified by:
getLastEvent
in interfaceAuditEventDao
type
- type of event to retrieve, augmented by its hierarchyexcludedTypes
- excluded event types (their hierarchy is also excluded)
-
getLastEvents
public <T extends Auditable> Map<T,AuditEvent> getLastEvents(Collection<T> auditables, Class<? extends AuditEventType> type)
Description copied from interface:AuditEventDao
Obtain the latest events of a specified type for all given auditables.- Specified by:
getLastEvents
in interfaceAuditEventDao
- See Also:
AuditEventDao.getLastEvent(Auditable, Class)
-
getLastEvents
public <T extends Auditable> Map<T,AuditEvent> getLastEvents(Class<T> auditableClass, Class<? extends AuditEventType> type)
Description copied from interface:AuditEventDao
Obtain the latest events of a specified type for all auditable of a given type.- Specified by:
getLastEvents
in interfaceAuditEventDao
- See Also:
AuditEventDao.getLastEvent(Auditable, Class)
-
getNewSinceDate
public <T extends Auditable> Collection<T> getNewSinceDate(Class<T> auditableClass, Date date)
Description copied from interface:AuditEventDao
Get auditables that have been created since the given date.- Specified by:
getNewSinceDate
in interfaceAuditEventDao
-
getUpdatedSinceDate
public <T extends Auditable> Collection<T> getUpdatedSinceDate(Class<T> auditableClass, Date date)
Description copied from interface:AuditEventDao
Get auditables that have been updated since the given date.- Specified by:
getUpdatedSinceDate
in interfaceAuditEventDao
-
getCreateEvents
public <T extends Auditable> Map<T,AuditEvent> getCreateEvents(Collection<T> auditables)
Description copied from interface:AuditEventDao
Obtain the creation events for the given auditables.If an auditable has more than one creation event (which is in itself a bug), the earliest one is returned.
- Specified by:
getCreateEvents
in interfaceAuditEventDao
-
-