1
|
package eu.etaxonomy.cdm.app.validate;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import eu.etaxonomy.cdm.app.common.CdmDestinations;
|
6
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
7
|
import eu.etaxonomy.cdm.database.update.test.ValidateForeignKeys;
|
8
|
import eu.etaxonomy.cdm.database.update.test.ValidateForeignKeys.FkTestResult;
|
9
|
|
10
|
public class ValidateKeys {
|
11
|
|
12
|
|
13
|
/**
|
14
|
* @param args
|
15
|
*/
|
16
|
public static void main(String[] args) {
|
17
|
ICdmDataSource source = CdmDestinations.cdm_cichorieae_preview();
|
18
|
// String server = "160.45.63.";
|
19
|
// String database = "";
|
20
|
// int port = 3306;
|
21
|
// String username = "edit";
|
22
|
// String pwd = "";
|
23
|
// DataSource source = CdmDataSource.NewInstance(DatabaseTypeEnum.MySQL, server, database, port, username, pwd);
|
24
|
ValidateForeignKeys m = new ValidateForeignKeys(source);
|
25
|
List<FkTestResult> list = m.invoke();
|
26
|
for (FkTestResult re : list){
|
27
|
String format = "Table %s, field %s, foreignTable %s, id %d";
|
28
|
System.out.println(String.format(format, re.table, re.field, re.foreignTable, re.id));
|
29
|
}
|
30
|
}
|
31
|
}
|