@groovy.transform.CompileStatic class DatasourceCleanupMapping extends java.lang.Object
Represents the parsed mapping entries from a DatabaseCleanup annotation's
value() attribute.
Each entry in the annotation value can be:
"datasourceName" — clean the named datasource, auto-discover the cleaner
via DatabaseCleaner.supports"datasourceName:databaseType" — clean the named datasource using the
cleaner that declares the specified DatabaseCleaner.databaseTypeIf the annotation value is empty (the default), all data sources in the application context are cleaned using auto-discovery.
Examples:
// Clean all data sources (auto-discover cleaners) @DatabaseCleanup // Clean specific data sources (auto-discover cleaners) @DatabaseCleanup(['dataSource', 'dataSource_secondary']) // Clean specific data sources with explicit cleaner types @DatabaseCleanup(['dataSource:h2', 'dataSource_pg:postgresql']) // Mixed: some explicit, some auto-discovered @DatabaseCleanup(['dataSource:h2', 'dataSource_other'])
| Modifiers | Name | Description |
|---|---|---|
static class |
DatasourceCleanupMapping.Entry |
A single parsed entry from the annotation value. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.util.List<Entry> |
getEntries()
|
|
boolean |
isCleanAll()
|
|
static DatasourceCleanupMapping |
parse(java.lang.String[] annotationValues)Parses the raw annotation value array into a DatasourceCleanupMapping. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
true if no specific data sources were specified, meaning all
datas ources in the application context should be cleanedParses the raw annotation value array into a DatasourceCleanupMapping.
Each entry is parsed as either "name" (datasource name only, auto-discover
cleaner) or "name:type" (datasource name with explicit database type).
annotationValues - the raw string array from DatabaseCleanup.value