Revision 42154e07
Added by Andreas Müller over 6 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/caryophyllales/DeleteNonReferencedReferences.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
public class DeleteNonReferencedReferences { |
15 | 15 |
|
16 |
@SuppressWarnings("unused") |
|
17 |
private static final Logger logger = Logger.getLogger(DeleteNonReferencedReferences.class); |
|
16 | 18 |
|
19 |
//database validation status (create, update, validate ...) |
|
20 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
|
21 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_caryo(); |
|
17 | 22 |
|
23 |
private ImportResult doInvoke(ICdmDataSource destination){ |
|
24 |
ImportResult result = new ImportResult(); |
|
18 | 25 |
|
26 |
DeleteNonReferencedReferencesConfigurator config; |
|
27 |
config = DeleteNonReferencedReferencesConfigurator.NewInstance(destination); |
|
19 | 28 |
|
20 |
private static final Logger logger = Logger.getLogger(DeleteNonReferencedReferences.class); |
|
21 |
|
|
22 |
//database validation status (create, update, validate ...) |
|
23 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
|
24 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_caryo(); |
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
private ImportResult doInvoke(ICdmDataSource destination){ |
|
31 |
ImportResult result = new ImportResult(); |
|
32 |
|
|
33 |
DeleteNonReferencedReferencesConfigurator config; |
|
34 |
config = DeleteNonReferencedReferencesConfigurator.NewInstance(cdmDestination); |
|
35 |
|
|
36 |
// invoke import |
|
37 |
CdmDefaultImport<DeleteNonReferencedReferencesConfigurator> myImport = new CdmDefaultImport<DeleteNonReferencedReferencesConfigurator>(); |
|
38 |
result = myImport.invoke(config); |
|
39 |
//String successString = success ? "successful" : " with errors "; |
|
40 |
//System.out.println("End updating caches for "+ destination.getDatabase() + "..." + successString); |
|
41 |
return result; |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* @param args |
|
46 |
*/ |
|
47 |
public static void main(String[] args) { |
|
48 |
ICdmDataSource destination = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination; |
|
29 |
// invoke import |
|
30 |
CdmDefaultImport<DeleteNonReferencedReferencesConfigurator> myImport = new CdmDefaultImport<>(); |
|
31 |
result = myImport.invoke(config); |
|
32 |
//String successString = success ? "successful" : " with errors "; |
|
33 |
//System.out.println("End updating caches for "+ destination.getDatabase() + "..." + successString); |
|
34 |
return result; |
|
35 |
} |
|
49 | 36 |
|
50 |
System.out.println("Start deleting non referenced objects for "+ destination.getDatabase() + "..."); |
|
51 |
DeleteNonReferencedReferences me = new DeleteNonReferencedReferences(); |
|
52 |
me.doInvoke(destination); |
|
37 |
/** |
|
38 |
* @param args |
|
39 |
*/ |
|
40 |
public static void main(String[] args) { |
|
41 |
ICdmDataSource destination = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination; |
|
53 | 42 |
|
54 |
} |
|
43 |
System.out.println("Start deleting non referenced objects for "+ destination.getDatabase() + "..."); |
|
44 |
DeleteNonReferencedReferences me = new DeleteNonReferencedReferences(); |
|
45 |
me.doInvoke(destination); |
|
55 | 46 |
|
56 | 47 |
} |
57 | 48 |
|
58 |
|
|
59 |
|
|
49 |
} |
|
60 | 50 |
|
Also available in: Unified diff
cleanup