Project

General

Profile

« Previous | Next » 

Revision 817f2688

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/RedListGefaesspflanzenImportAuthor.java
47 47

  
48 48
    @Override
49 49
    protected String getIdQuery(RedListGefaesspflanzenImportState state) {
50
        return "SELECT NAMNR "
50
        return "SELECT SEQNUM "
51 51
                + "FROM V_TAXATLAS_D20_EXPORT t "
52
                + " ORDER BY NAMNR";
52
                + " ORDER BY SEQNUM";
53 53
    }
54 54

  
55 55
    @Override
56 56
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
57 57
        String result = " SELECT * "
58 58
                + " FROM V_TAXATLAS_D20_EXPORT t "
59
                + " WHERE t.NAMNR IN (@IDSET)";
59
                + " WHERE t.SEQNUM IN (@IDSET)";
60 60
        result = result.replace("@IDSET", IPartitionedIO.ID_LIST_TOKEN);
61 61
        return result;
62 62
    }
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
63 63

  
64 64
    @Override
65 65
    protected String getIdQuery(RedListGefaesspflanzenImportState state) {
66
        return "SELECT NAMNR "
66
        return "SELECT SEQNUM "
67 67
                + "FROM V_TAXATLAS_D20_EXPORT t "
68
                + " ORDER BY NAMNR";
68
                + " ORDER BY SEQNUM";
69 69
    }
70 70

  
71 71
    @Override
72 72
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
73 73
        String result = "select distinct e.*, f.FAMILIE "
74 74
                + "from V_TAXATLAS_D20_EXPORT e, GATTUNG_FAMILIE f "
75
                + "where e.EPI1 = f.GATTUNG and e.NAMNR IN (@IDSET)";
75
                + "where e.EPI1 = f.GATTUNG and e.SEQNUM IN (@IDSET)";
76 76
        result = result.replace("@IDSET", IPartitionedIO.ID_LIST_TOKEN);
77 77
        return result;
78 78
    }
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