JBoss.orgCommunity Documentation
It is special service for removing data from database.
Code that invokes methods of DBCleanerService must have JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION permission;
There are two methods of DBCleanerService:
Table 44.1. API
| public void cleanWorkspaceData(WorkspaceEntry wsEntry) | Clean workspace data from database. Tables will be removed in case of multiDB, and only records will be removed in case of singleDB. |
| public void cleanRepositoryData(RepositoryEntry repoEntry) | Cleanup repository data from database. |
cleanRepositoryData takes workspaces configs from RepositoryEntry and clean each workspace using cleanWorkspaceData method.
Lets see cleanWorkspaceData in detail:
at first, it resolves container name (workspace name), database dialect, data source and isMultiDB parameter;
then based on database dialect creates instanse of database cleaner (implements DBCleaner interface) and invokes clean() method;