Class CleanEntity


  • @ApplicationScoped
    public class CleanEntity
    extends Object
    Default implementation to clean up an entity. In case specific actions are required for a concrete entity, this class can be extended using as Qualifier the name of the entity, in this way that class will be invoked instead of this default one.
    Author:
    alostale
    • Constructor Detail

      • CleanEntity

        public CleanEntity()
    • Method Detail

      • clean

        public int clean​(LogCleanUpConfig config,
                         Client client,
                         Organization org,
                         ProcessLogger bgLogger)
        Clean logs for an entity
        Parameters:
        config - Configuration regarding how the entity should be cleaned up, such as the number of days of info to keep, where clauses, etc.
        client - Client to remove data from, in case it is System, all clients will be cleaned up
        org - If client is not System, data from this organization and the ones in its tree will be removed
        bgLogger - Log to be displayed in Process Request window
        Returns:
        number of deleted rows
      • getClientOrgFilter

        protected String getClientOrgFilter​(Client client,
                                            Organization org)
        Returns the where clause to add to the HQL query to add client/org filtering