Class AuditEventUtil
com.liferay.portal.security.audit.storage.service.persistence.impl.AuditEventPersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
Caching information and settings can be found in portal.properties
- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheResult(AuditEvent auditEvent) Caches the audit event in the entity cache if it is enabled.static voidcacheResult(List<AuditEvent> auditEvents) Caches the audit events in the entity cache if it is enabled.static voidstatic voidclearCache(AuditEvent auditEvent) static intcountAll()Returns the number of audit events.static intcountByCompanyId(long companyId) Returns the number of audit events where companyId = ?.static longcountWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) static AuditEventcreate(long auditEventId) Creates a new audit event with the primary key.static AuditEventfetchByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the first audit event in the ordered set where companyId = ?.static AuditEventfetchByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the last audit event in the ordered set where companyId = ?.static AuditEventfetchByPrimaryKey(long auditEventId) Returns the audit event with the primary key or returnsnullif it could not be found.static Map<Serializable,AuditEvent> fetchByPrimaryKeys(Set<Serializable> primaryKeys) static List<AuditEvent>findAll()Returns all the audit events.static List<AuditEvent>findAll(int start, int end) Returns a range of all the audit events.static List<AuditEvent>findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns an ordered range of all the audit events.static List<AuditEvent>findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the audit events.static List<AuditEvent>findByCompanyId(long companyId) Returns all the audit events where companyId = ?.static List<AuditEvent>findByCompanyId(long companyId, int start, int end) Returns a range of all the audit events where companyId = ?.static List<AuditEvent>findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns an ordered range of all the audit events where companyId = ?.static List<AuditEvent>findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the audit events where companyId = ?.static AuditEventfindByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the first audit event in the ordered set where companyId = ?.static AuditEventfindByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the last audit event in the ordered set where companyId = ?.static AuditEvent[]findByCompanyId_PrevAndNext(long auditEventId, long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the audit events before and after the current audit event in the ordered set where companyId = ?.static AuditEventfindByPrimaryKey(long auditEventId) Returns the audit event with the primary key or throws aNoSuchEventExceptionif it could not be found.static List<AuditEvent>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) static List<AuditEvent>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) static List<AuditEvent>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) static AuditEventPersistencestatic AuditEventremove(long auditEventId) Removes the audit event with the primary key from the database.static voidRemoves all the audit events from the database.static voidremoveByCompanyId(long companyId) Removes all the audit events where companyId = ? from the database.static voidsetPersistence(AuditEventPersistence persistence) static AuditEventupdate(AuditEvent auditEvent) static AuditEventupdate(AuditEvent auditEvent, com.liferay.portal.kernel.service.ServiceContext serviceContext) static AuditEventupdateImpl(AuditEvent auditEvent)
-
Constructor Details
-
AuditEventUtil
public AuditEventUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
BasePersistence.clearCache()
-
clearCache
- See Also:
-
BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
-
countWithDynamicQuery
public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) - See Also:
-
BasePersistence.countWithDynamicQuery(DynamicQuery)
-
fetchByPrimaryKeys
- See Also:
-
BasePersistence.fetchByPrimaryKeys(Set)
-
findWithDynamicQuery
public static List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery)
-
findWithDynamicQuery
public static List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
-
findWithDynamicQuery
public static List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) - See Also:
-
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
-
update
- See Also:
-
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
-
update
public static AuditEvent update(AuditEvent auditEvent, com.liferay.portal.kernel.service.ServiceContext serviceContext) - See Also:
-
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
-
findByCompanyId
Returns all the audit events where companyId = ?.- Parameters:
companyId- the company ID- Returns:
- the matching audit events
-
findByCompanyId
Returns a range of all the audit events where companyId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
companyId- the company IDstart- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)- Returns:
- the range of matching audit events
-
findByCompanyId
public static List<AuditEvent> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns an ordered range of all the audit events where companyId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
companyId- the company IDstart- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching audit events
-
findByCompanyId
public static List<AuditEvent> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the audit events where companyId = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
companyId- the company IDstart- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of matching audit events
-
findByCompanyId_First
public static AuditEvent findByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException Returns the first audit event in the ordered set where companyId = ?.- Parameters:
companyId- the company IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching audit event
- Throws:
NoSuchEventException- if a matching audit event could not be foundNoSuchEventException
-
fetchByCompanyId_First
public static AuditEvent fetchByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the first audit event in the ordered set where companyId = ?.- Parameters:
companyId- the company IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching audit event, or
nullif a matching audit event could not be found
-
findByCompanyId_Last
public static AuditEvent findByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException Returns the last audit event in the ordered set where companyId = ?.- Parameters:
companyId- the company IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching audit event
- Throws:
NoSuchEventException- if a matching audit event could not be foundNoSuchEventException
-
fetchByCompanyId_Last
public static AuditEvent fetchByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns the last audit event in the ordered set where companyId = ?.- Parameters:
companyId- the company IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching audit event, or
nullif a matching audit event could not be found
-
findByCompanyId_PrevAndNext
public static AuditEvent[] findByCompanyId_PrevAndNext(long auditEventId, long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException Returns the audit events before and after the current audit event in the ordered set where companyId = ?.- Parameters:
auditEventId- the primary key of the current audit eventcompanyId- the company IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the previous, current, and next audit event
- Throws:
NoSuchEventException- if a audit event with the primary key could not be foundNoSuchEventException
-
removeByCompanyId
public static void removeByCompanyId(long companyId) Removes all the audit events where companyId = ? from the database.- Parameters:
companyId- the company ID
-
countByCompanyId
public static int countByCompanyId(long companyId) Returns the number of audit events where companyId = ?.- Parameters:
companyId- the company ID- Returns:
- the number of matching audit events
-
cacheResult
Caches the audit event in the entity cache if it is enabled.- Parameters:
auditEvent- the audit event
-
cacheResult
Caches the audit events in the entity cache if it is enabled.- Parameters:
auditEvents- the audit events
-
create
Creates a new audit event with the primary key. Does not add the audit event to the database.- Parameters:
auditEventId- the primary key for the new audit event- Returns:
- the new audit event
-
remove
Removes the audit event with the primary key from the database. Also notifies the appropriate model listeners.- Parameters:
auditEventId- the primary key of the audit event- Returns:
- the audit event that was removed
- Throws:
NoSuchEventException- if a audit event with the primary key could not be foundNoSuchEventException
-
updateImpl
-
findByPrimaryKey
Returns the audit event with the primary key or throws aNoSuchEventExceptionif it could not be found.- Parameters:
auditEventId- the primary key of the audit event- Returns:
- the audit event
- Throws:
NoSuchEventException- if a audit event with the primary key could not be foundNoSuchEventException
-
fetchByPrimaryKey
Returns the audit event with the primary key or returnsnullif it could not be found.- Parameters:
auditEventId- the primary key of the audit event- Returns:
- the audit event, or
nullif a audit event with the primary key could not be found
-
findAll
Returns all the audit events.- Returns:
- the audit events
-
findAll
Returns a range of all the audit events.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
start- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)- Returns:
- the range of audit events
-
findAll
public static List<AuditEvent> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) Returns an ordered range of all the audit events.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
start- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of audit events
-
findAll
public static List<AuditEvent> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the audit events.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromAuditEventModelImpl.- Parameters:
start- the lower bound of the range of audit eventsend- the upper bound of the range of audit events (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of audit events
-
removeAll
public static void removeAll()Removes all the audit events from the database. -
countAll
public static int countAll()Returns the number of audit events.- Returns:
- the number of audit events
-
getPersistence
-
setPersistence
-