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 TypeMethodDescriptionvoid
autoAnonymizeAll
(long userId, com.liferay.portal.kernel.model.User anonymousUser) Performs anonymization on all entities of typeT
related to the user.long
count
(long userId) Returns the number of typeT
entities associated with the user.void
deleteAll
(long userId) Deletes all typeT
entities related to the user from the database.protected abstract com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
Returns anActionableDynamicQuery
for typeT
.protected abstract String[]
Returns the names identifying fields on the typeT
entity that contain the primary key of a user.protected com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
getActionableDynamicQuery
(long userId) Returns anActionableDynamicQuery
for typeT
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.liferay.user.associated.data.anonymizer.UADAnonymizer
autoAnonymize, delete, getExceptionMessageMap
Methods 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:UADAnonymizer
Performs anonymization on all entities of typeT
related to the user. This method is responsible for retrieving the relevant entities, performing anonymization, and persisting the changes.- Specified by:
autoAnonymizeAll
in 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:UADAnonymizer
Returns the number of typeT
entities associated with the user.- Specified by:
count
in 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:UADAnonymizer
Deletes all typeT
entities related to the user from the database.- Specified by:
deleteAll
in 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 anActionableDynamicQuery
for typeT
. This can be retrieved from the service.- Returns:
- an
ActionableDynamicQuery
for typeT
-
doGetUserIdFieldNames
Returns the names identifying fields on the typeT
entity 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 anActionableDynamicQuery
for 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
-