Project

General

Profile

« Previous | Next » 

Revision d2a9d564

Added by Patrick Plitzner over 7 years ago

#5448 Use SEQNUM as id column

  • enhance hybrid name check

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportNames.java
79 79

  
80 80
    @Override
81 81
    protected String getIdQuery(RedListGefaesspflanzenImportState state) {
82
        return "SELECT NAMNR "
82
        return "SELECT SEQNUM "
83 83
                + "FROM V_TAXATLAS_D20_EXPORT t "
84
                + " ORDER BY NAMNR";
84
                + " ORDER BY SEQNUM";
85 85
    }
86 86

  
87 87
    @Override
88 88
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
89 89
        String result = " SELECT * "
90 90
                + " FROM V_TAXATLAS_D20_EXPORT t "
91
                + " WHERE t.NAMNR IN (@IDSET)";
91
                + " WHERE t.SEQNUM IN (@IDSET)";
92 92
        result = result.replace("@IDSET", IPartitionedIO.ID_LIST_TOKEN);
93 93
        return result;
94 94
    }
......
345 345
        }
346 346

  
347 347
        NonViralName<?> name = null;
348
        Rank rank = makeRank(id, state, rangString, ep3String!=null);
348
        Rank rank = makeRank(id, state, rangString, CdmUtils.isNotBlank(ep3String));
349 349
        //cultivar
350 350
        if(rank!= null && rank.equals(Rank.CULTIVAR())){
351 351
            CultivarPlantName cultivar = CultivarPlantName.NewInstance(rank);
......
432 432
                            hybridFormula2 = split[1];
433 433
                        }
434 434
                        if(CdmUtils.isNotBlank(ep3String)){
435
                            hybridFormula1 += " "+ep3String;
436
                            hybridFormula2 += " "+ep3String;
435
                            hybridFormula1 += " "+rank.getAbbreviation()+" "+ep3String;
436
                            hybridFormula2 += " "+rank.getAbbreviation()+" "+ep3String;
437 437
                        }
438 438
                        String fullFormula = hybridFormula1+" "+RedListUtil.HYB_SIGN+" "+hybridFormula2;
439 439
                        name = NonViralNameParserImpl.NewInstance().parseFullName(fullFormula, NomenclaturalCode.ICNAFP, rank);
440 440
                    }
441 441
                    else if(ep3String.contains(RedListUtil.HYB_SIGN)){
442 442
                        String[] split = ep3String.split(RedListUtil.HYB_SIGN);
443
                        String hybridFormula1 = ep1String+" "+ep2String+" "+split[0];
444
                        String hybridFormula2 = ep1String+" "+ep2String+" "+split[1];
443
                        String hybridFormula1 = ep1String+" "+ep2String+" "+rank.getAbbreviation()+" "+split[0];
444
                        String hybridFormula2 = ep1String+" "+ep2String+" "+rank.getAbbreviation()+" "+split[1];
445 445
                        //check if the genus is mentioned in EP3 or not
446 446
                        String[] secondHybrid = split[1].trim().split(" ");
447 447
                        //check if the genus is abbreviated like e.g. Centaurea jacea jacea × C. jacea subsp. decipiens

Also available in: Unified diff