@ProviderType
public class AuditEventUtil
extends java.lang.Object
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
AuditEventPersistence
,
com.liferay.portal.security.audit.storage.service.persistence.impl.AuditEventPersistenceImpl
Constructor and Description |
---|
AuditEventUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(AuditEvent auditEvent)
Caches the audit event in the entity cache if it is enabled.
|
static void |
cacheResult(java.util.List<AuditEvent> auditEvents)
Caches the audit events in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(AuditEvent auditEvent) |
static int |
countAll()
Returns the number of audit events.
|
static int |
countByCompanyId(long companyId)
Returns the number of audit events where companyId = ?.
|
static long |
countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static AuditEvent |
create(long auditEventId)
Creates a new audit event with the primary key.
|
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 = ?.
|
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 = ?.
|
static AuditEvent |
fetchByPrimaryKey(long auditEventId)
Returns the audit event with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,AuditEvent> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static java.util.List<AuditEvent> |
findAll()
Returns all the audit events.
|
static java.util.List<AuditEvent> |
findAll(int start,
int end)
Returns a range of all the audit events.
|
static java.util.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 java.util.List<AuditEvent> |
findAll(int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the audit events.
|
static AuditEvent |
findByCompanyId_First(long companyId,
com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
Returns the first audit event in the ordered set where companyId = ?.
|
static AuditEvent |
findByCompanyId_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 java.util.List<AuditEvent> |
findByCompanyId(long companyId)
Returns all the audit events where companyId = ?.
|
static java.util.List<AuditEvent> |
findByCompanyId(long companyId,
int start,
int end)
Returns a range of all the audit events where companyId = ?.
|
static java.util.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 java.util.List<AuditEvent> |
findByCompanyId(long companyId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the audit events where companyId = ?.
|
static AuditEvent |
findByPrimaryKey(long auditEventId)
Returns the audit event with the primary key or throws a
NoSuchEventException if it could not be found. |
static java.util.List<AuditEvent> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static java.util.List<AuditEvent> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<AuditEvent> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) |
static AuditEventPersistence |
getPersistence() |
static AuditEvent |
remove(long auditEventId)
Removes the audit event with the primary key from the database.
|
static void |
removeAll()
Removes all the audit events from the database.
|
static void |
removeByCompanyId(long companyId)
Removes all the audit events where companyId = ? from the database.
|
static AuditEvent |
update(AuditEvent auditEvent) |
static AuditEvent |
update(AuditEvent auditEvent,
com.liferay.portal.kernel.service.ServiceContext serviceContext) |
static AuditEvent |
updateImpl(AuditEvent auditEvent) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(AuditEvent auditEvent)
BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static java.util.List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static java.util.List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static java.util.List<AuditEvent> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static AuditEvent update(AuditEvent auditEvent)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
public static AuditEvent update(AuditEvent auditEvent, com.liferay.portal.kernel.service.ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
public static java.util.List<AuditEvent> findByCompanyId(long companyId)
companyId
- the company IDpublic static java.util.List<AuditEvent> findByCompanyId(long companyId, int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDstart
- the lower bound of the range of audit eventsend
- the upper bound of the range of audit events (not inclusive)public static java.util.List<AuditEvent> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
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 (optionally null
)public static java.util.List<AuditEvent> findByCompanyId(long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean retrieveFromCache)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
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 (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static AuditEvent findByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEventException
- if a matching audit event could not be foundpublic static AuditEvent fetchByCompanyId_First(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching audit event could not be foundpublic static AuditEvent findByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEventException
- if a matching audit event could not be foundpublic static AuditEvent fetchByCompanyId_Last(long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching audit event could not be foundpublic static AuditEvent[] findByCompanyId_PrevAndNext(long auditEventId, long companyId, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator) throws NoSuchEventException
auditEventId
- the primary key of the current audit eventcompanyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchEventException
- if a audit event with the primary key could not be foundpublic static void removeByCompanyId(long companyId)
companyId
- the company IDpublic static int countByCompanyId(long companyId)
companyId
- the company IDpublic static void cacheResult(AuditEvent auditEvent)
auditEvent
- the audit eventpublic static void cacheResult(java.util.List<AuditEvent> auditEvents)
auditEvents
- the audit eventspublic static AuditEvent create(long auditEventId)
auditEventId
- the primary key for the new audit eventpublic static AuditEvent remove(long auditEventId) throws NoSuchEventException
auditEventId
- the primary key of the audit eventNoSuchEventException
- if a audit event with the primary key could not be foundpublic static AuditEvent updateImpl(AuditEvent auditEvent)
public static AuditEvent findByPrimaryKey(long auditEventId) throws NoSuchEventException
NoSuchEventException
if it could not be found.auditEventId
- the primary key of the audit eventNoSuchEventException
- if a audit event with the primary key could not be foundpublic static AuditEvent fetchByPrimaryKey(long auditEventId)
null
if it could not be found.auditEventId
- the primary key of the audit eventnull
if a audit event with the primary key could not be foundpublic static java.util.Map<java.io.Serializable,AuditEvent> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
public static java.util.List<AuditEvent> findAll()
public static java.util.List<AuditEvent> findAll(int start, int end)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
start
- the lower bound of the range of audit eventsend
- the upper bound of the range of audit events (not inclusive)public static java.util.List<AuditEvent> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
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 (optionally null
)public static java.util.List<AuditEvent> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<AuditEvent> orderByComparator, boolean retrieveFromCache)
Useful when paginating results. Returns a maximum of end - start
instances. start
and end
are not primary keys, they are indexes in the result set. Thus, 0
refers to the first result in the set. Setting both start
and end
to QueryUtil#ALL_POS
will return the full result set. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from AuditEventModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
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 (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static void removeAll()
public static int countAll()
public static AuditEventPersistence getPersistence()