public abstract class DynamicQueryUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel> extends java.lang.Object implements UADAnonymizer<T>
UADAnonymizer
for entities
created using Service Builder. The count and batch actions are based on
ActionableDynamicQuery
, which is available in the service for the
type T
entity.Constructor and Description |
---|
DynamicQueryUADAnonymizer() |
Modifier and Type | Method and Description |
---|---|
void |
autoAnonymizeAll(long userId,
com.liferay.portal.kernel.model.User anonymousUser)
Performs anonymization on all entities of type
T related to the
user. |
long |
count(long userId)
Returns the number of type
T entities associated with the user. |
void |
deleteAll(long userId)
Deletes all type
T entities related to the user from the
database. |
protected abstract com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery |
doGetActionableDynamicQuery()
Returns an
ActionableDynamicQuery for type T . |
protected abstract java.lang.String[] |
doGetUserIdFieldNames()
Returns the names identifying fields on the type
T entity that
contain the primary key of a user. |
protected com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery |
getActionableDynamicQuery(long userId)
Returns an
ActionableDynamicQuery for type T . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
autoAnonymize, delete, getExceptionMessageMap
getTypeClass
public void autoAnonymizeAll(long userId, com.liferay.portal.kernel.model.User anonymousUser) throws com.liferay.portal.kernel.exception.PortalException
UADAnonymizer
T
related to the
user. This method is responsible for retrieving the relevant entities,
performing anonymization, and persisting the changes.autoAnonymizeAll
in interface UADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>
userId
- the primary key of the user whose data is being anonymizedanonymousUser
- the company's anonymous usercom.liferay.portal.kernel.exception.PortalException
- if the persistence threw an exceptionpublic long count(long userId) throws com.liferay.portal.kernel.exception.PortalException
UADAnonymizer
T
entities associated with the user.count
in interface UADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>
userId
- the primary key of the user whose data to countcom.liferay.portal.kernel.exception.PortalException
public void deleteAll(long userId) throws com.liferay.portal.kernel.exception.PortalException
UADAnonymizer
T
entities related to the user from the
database.deleteAll
in interface UADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>
userId
- the primary key of the user whose data to deletecom.liferay.portal.kernel.exception.PortalException
- if a portal exception occurredprotected abstract com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery doGetActionableDynamicQuery()
ActionableDynamicQuery
for type T
. This can be
retrieved from the service.ActionableDynamicQuery
for type T
protected abstract java.lang.String[] doGetUserIdFieldNames()
T
entity that
contain the primary key of a user.protected com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(long userId)
ActionableDynamicQuery
for type T
. It should
be populated with criteria and ready for use by the service.userId
- the primary key of the user to pre-filter the ActionableDynamicQuery
ActionableDynamicQuery