public abstract class DynamicQueryUADAnonymizer<T extends 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,
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 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 ActionableDynamicQuery |
getActionableDynamicQuery(long userId)
Returns an
ActionableDynamicQuery for type T. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitautoAnonymize, delete, getExceptionMessageMapgetTypeClasspublic void autoAnonymizeAll(long userId,
User anonymousUser)
throws PortalException
UADAnonymizerT 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 BaseModel>userId - the primary key of the user whose data is being anonymizedanonymousUser - the company's anonymous userPortalException - if the persistence threw an exceptionpublic long count(long userId)
throws PortalException
UADAnonymizerT entities associated with the user.count in interface UADAnonymizer<T extends BaseModel>userId - the primary key of the user whose data to countPortalExceptionpublic void deleteAll(long userId)
throws PortalException
UADAnonymizerT entities related to the user from the
database.deleteAll in interface UADAnonymizer<T extends BaseModel>userId - the primary key of the user whose data to deletePortalException - if a portal exception occurredprotected abstract ActionableDynamicQuery doGetActionableDynamicQuery()
ActionableDynamicQuery for type T. This can be
retrieved from the service.ActionableDynamicQuery for type Tprotected abstract java.lang.String[] doGetUserIdFieldNames()
T entity that
contain the primary key of a user.protected 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 ActionableDynamicQueryActionableDynamicQuery