Revision 981ec2fb
Added by Andreas Müller over 5 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/validation/BerlinModelCommonNamesImportValidator.java | ||
---|---|---|
164 | 164 |
boolean result = true; |
165 | 165 |
Source source = config.getSource(); |
166 | 166 |
String strQueryArticlesWithoutJournal = "SELECT Count(*) as n " + |
167 |
" FROM emCommonName " + |
|
168 |
" WHERE (emCommonName.LanguageRefFk NOT IN " +
|
|
167 |
" FROM emCommonName cn INNER JOIN PTaxon pt ON pt.PTNameFk = cn.PTNameFk AND pt.PTRefFk = cn.PTRefFk " +
|
|
168 |
" WHERE (cn.LanguageRefFk NOT IN " +
|
|
169 | 169 |
"(SELECT ReferenceId FROM emLanguageReference)) AND " + |
170 |
"(emCommonName.LanguageRefFk is NOT NULL)"; |
|
170 |
"(cn.LanguageRefFk is NOT NULL) AND " |
|
171 |
+ " cn.LanguageRefFk <> cn.RefFk " |
|
172 |
+ " AND pt.statusFk NOT IN (6) "; |
|
171 | 173 |
ResultSet rs = source.getResultSet(strQueryArticlesWithoutJournal); |
172 | 174 |
rs.next(); |
173 | 175 |
int count = rs.getInt("n"); |
174 | 176 |
if (count > 0){ |
175 |
System.out.println("========================================================"); |
|
176 |
System.out.println("There are " + count + " common names that have a languageRefFk which can not be found in the emLanguageReference table."); |
|
177 |
System.out.println("========================================================"); |
|
177 |
System.out.println("============================================================================");
|
|
178 |
System.out.println("There are " + count + " common names that have a languageRefFk which can not be found in the emLanguageReference table AND are not equal to RefFk.");
|
|
179 |
System.out.println("============================================================================");
|
|
178 | 180 |
} |
179 | 181 |
if (count > 0){ |
180 | 182 |
System.out.println(" "); |
Also available in: Unified diff
improve commonName import validation