Class DynamicQueryUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>
java.lang.Object
com.liferay.user.associated.data.anonymizer.DynamicQueryUADAnonymizer<T>
- All Implemented Interfaces:
UADAnonymizer<T>,UADComponent<T>
public abstract class DynamicQueryUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>
extends Object
implements UADAnonymizer<T>
Provides the base implementation of
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidautoAnonymizeAll(long userId, com.liferay.portal.kernel.model.User anonymousUser) Performs anonymization on all entities of typeTrelated to the user.longcount(long userId) Returns the number of typeTentities associated with the user.voiddeleteAll(long userId) Deletes all typeTentities related to the user from the database.protected abstract com.liferay.portal.kernel.dao.orm.ActionableDynamicQueryReturns anActionableDynamicQueryfor typeT.protected abstract String[]Returns the names identifying fields on the typeTentity that contain the primary key of a user.protected com.liferay.portal.kernel.dao.orm.ActionableDynamicQuerygetActionableDynamicQuery(long userId) Returns anActionableDynamicQueryfor typeT.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.user.associated.data.anonymizer.UADAnonymizer
autoAnonymize, delete, getExceptionMessageMapMethods inherited from interface com.liferay.user.associated.data.component.UADComponent
getTypeClass, getTypeKey
-
Constructor Details
-
DynamicQueryUADAnonymizer
public DynamicQueryUADAnonymizer()
-
-
Method Details
-
autoAnonymizeAll
public void autoAnonymizeAll(long userId, com.liferay.portal.kernel.model.User anonymousUser) throws com.liferay.portal.kernel.exception.PortalException Description copied from interface:UADAnonymizerPerforms anonymization on all entities of typeTrelated to the user. This method is responsible for retrieving the relevant entities, performing anonymization, and persisting the changes.- Specified by:
autoAnonymizeAllin interfaceUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>- Parameters:
userId- the primary key of the user whose data is being anonymizedanonymousUser- the company's anonymous user- Throws:
com.liferay.portal.kernel.exception.PortalException- if the persistence threw an exception
-
count
public long count(long userId) throws com.liferay.portal.kernel.exception.PortalException Description copied from interface:UADAnonymizerReturns the number of typeTentities associated with the user.- Specified by:
countin interfaceUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>- Parameters:
userId- the primary key of the user whose data to count- Returns:
- the number of entities associated with the user
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteAll
public void deleteAll(long userId) throws com.liferay.portal.kernel.exception.PortalException Description copied from interface:UADAnonymizerDeletes all typeTentities related to the user from the database.- Specified by:
deleteAllin interfaceUADAnonymizer<T extends com.liferay.portal.kernel.model.BaseModel>- Parameters:
userId- the primary key of the user whose data to delete- Throws:
com.liferay.portal.kernel.exception.PortalException- if a portal exception occurred
-
doGetActionableDynamicQuery
protected abstract com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery doGetActionableDynamicQuery()Returns anActionableDynamicQueryfor typeT. This can be retrieved from the service.- Returns:
- an
ActionableDynamicQueryfor typeT
-
doGetUserIdFieldNames
Returns the names identifying fields on the typeTentity that contain the primary key of a user.- Returns:
- the fields that may contain the primary key of a user
-
getActionableDynamicQuery
protected com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(long userId) Returns anActionableDynamicQueryfor typeT. It should be populated with criteria and ready for use by the service.- Parameters:
userId- the primary key of the user to pre-filter theActionableDynamicQuery- Returns:
- a pre-filtered
ActionableDynamicQuery
-