Project

General

Profile

Revision bf021c7c

IDbf021c7cd518df104c7c0464e6de8cf4efb06339
Parent a6f0466b
Child c616b466

Added by Katja Luther about 4 years ago

minor

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImpl.java
1474 1474
                if(doAreaRestriction){
1475 1475
                    misappliedSelect = String.format(doAreaRestrictionMisappliedNameSubSelect, "t") + doTaxonNameJoin + doMisappliedNamesJoin  +
1476 1476
                    " WHERE " + doAreaRestrictionWhere +
1477
                    " AND " + String.format(doSearchFieldWhere, "n") +
1477
                    " AND " + String.format(doSearchFieldWhere, "n2") +
1478 1478
                    " AND " + doClassificationForMisappliedNamesWhere +
1479 1479
                    " AND " + doRelationshipTypeComparison;
1480 1480

  
......
1491 1491
                            " AND "+ doClassificationWhere + " AND " + doCommonNamesRestrictionWhere;
1492 1492
                } else {
1493 1493
                    misappliedSelect = String.format(doTaxonMisappliedNameSubSelect, "t" ) + doTaxonNameJoin + doMisappliedNamesJoin +
1494
                    " WHERE " + String.format(doSearchFieldWhere, "n") +
1494
                    " WHERE " + String.format(doSearchFieldWhere, "n2") +
1495 1495
                    " AND " + doClassificationForMisappliedNamesWhere +
1496 1496
                    " AND " + doRelationshipTypeComparison;
1497 1497

  
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceSearchTaxaAndNamesTest.java
283 283
        assertEquals(8, pager.getRecords().size());
284 284

  
285 285
        // FIXME the Synonym Abies subalpina missing in result set
286
//        setTaxaAndNamesModes(conf, false, true, true, false, false);
287
//        pager = taxonService.findTaxaAndNames(conf);
288
//        logSearchResults(pager, Level.DEBUG);
289
//        assertEquals(1, pager.getRecords().size());
286
        setTaxaAndNamesModes(conf, false, true, true, false, false);
287
        pager = taxonService.findTaxaAndNames(conf);
288
        logSearchResults(pager, Level.DEBUG);
289
        assertEquals(1, pager.getRecords().size());
290 290

  
291 291
        setTaxaAndNamesModes(conf, true, false, true, false, false);
292 292
        pager = taxonService.findTaxaAndNames(conf);
......
353 353
        assertEquals(5, pager.getRecords().size());
354 354

  
355 355
        // FIXME the Synonym Abies subalpina missing in result set
356
//        setTaxaAndNamesModes(conf, false, true, true, true, true);
357
//        pager = taxonService.findTaxaAndNames(conf);
358
//        logSearchResults(pager, Level.DEBUG);
359
//        assertEquals(4, pager.getRecords().size());
356
        setTaxaAndNamesModes(conf, false, true, true, true, true);
357
        pager = taxonService.findTaxaAndNames(conf);
358
        logSearchResults(pager, Level.DEBUG);
359
        assertEquals(4, pager.getRecords().size());
360 360

  
361 361
        setTaxaAndNamesModes(conf, true, false, true, true, true);
362 362
        pager = taxonService.findTaxaAndNames(conf);
......
375 375

  
376 376

  
377 377
     // FIXME org.hibernate.QueryParameterException: could not locate named parameter [taxa]
378
     //   setTaxaAndNamesModes(conf, false, true, false, true, true);
379
     //   pager = taxonService.findTaxaAndNames(conf);
380
     //   assertEquals(4, pager.getRecords().size());
378
        setTaxaAndNamesModes(conf, false, true, false, true, true);
379
        pager = taxonService.findTaxaAndNames(conf);
380
        assertEquals(4, pager.getRecords().size());
381 381

  
382 382
        setTaxaAndNamesModes(conf, true, false, false, true, true);
383 383
        pager = taxonService.findTaxaAndNames(conf);
......
395 395
        assertEquals(4, pager.getRecords().size());
396 396

  
397 397
        // FIXME the Synonym Abies subalpina missing in result set
398
//        setTaxaAndNamesModes(conf, false, true, true, false, true);
399
//        pager = taxonService.findTaxaAndNames(conf);
400
//        logSearchResults(pager, Level.DEBUG);
401
//        assertEquals(3, pager.getRecords().size());
398
        setTaxaAndNamesModes(conf, false, true, true, false, true);
399
        pager = taxonService.findTaxaAndNames(conf);
400
        logSearchResults(pager, Level.DEBUG);
401
        assertEquals(3, pager.getRecords().size());
402 402

  
403 403
        setTaxaAndNamesModes(conf, true, false, true, false, true);
404 404
        pager = taxonService.findTaxaAndNames(conf);
......
443 443
        assertEquals(3, pager.getRecords().size());
444 444

  
445 445
        // FIXME the Synonym Abies subalpina missing in result set
446
//        setTaxaAndNamesModes(conf, false, true, true, true, false);
447
//        pager = taxonService.findTaxaAndNames(conf);
448
//        logSearchResults(pager, Level.DEBUG);
449
//        assertEquals(2, pager.getRecords().size());
446
        setTaxaAndNamesModes(conf, false, true, true, true, false);
447
        pager = taxonService.findTaxaAndNames(conf);
448
        logSearchResults(pager, Level.DEBUG);
449
        assertEquals(2, pager.getRecords().size());
450 450

  
451 451
        setTaxaAndNamesModes(conf, true, false, true, true, false);
452 452
        pager = taxonService.findTaxaAndNames(conf);
......
466 466
        assertEquals(3, pager.getRecords().size());
467 467

  
468 468
        // FIXME org.hibernate.QueryParameterException: could not locate named parameter [taxa]
469
//        setTaxaAndNamesModes(conf, false, true, false, true, false);
470
//        pager = taxonService.findTaxaAndNames(conf);
471
//        logSearchResults(pager, Level.DEBUG);
472
//        assertEquals(2, pager.getRecords().size());
469
        setTaxaAndNamesModes(conf, false, true, false, true, false);
470
        pager = taxonService.findTaxaAndNames(conf);
471
        logSearchResults(pager, Level.DEBUG);
472
        assertEquals(2, pager.getRecords().size());
473 473

  
474 474
        setTaxaAndNamesModes(conf, true, false, false, true, false);
475 475
        pager = taxonService.findTaxaAndNames(conf);
......
491 491
        assertEquals(2, pager.getRecords().size());
492 492

  
493 493
        // FIXME the Synonym Abies subalpina missing in result set
494
//        setTaxaAndNamesModes(conf, false, true, true, false, false);
495
//        pager = taxonService.findTaxaAndNames(conf);
496
//        logSearchResults(pager, Level.DEBUG);
497
//        assertEquals(1, pager.getRecords().size());
494
        setTaxaAndNamesModes(conf, false, true, true, false, false);
495
        pager = taxonService.findTaxaAndNames(conf);
496
        logSearchResults(pager, Level.DEBUG);
497
        assertEquals(1, pager.getRecords().size());
498 498

  
499 499
        setTaxaAndNamesModes(conf, true, false, true, false, false);
500 500
        pager = taxonService.findTaxaAndNames(conf);
......
547 547
        configurator.setTitleSearchString("Balsam-Tanne");
548 548

  
549 549
        Pager<IdentifiableEntity> pager = taxonService.findTaxaAndNames(configurator);
550

  
550 551
        List<IdentifiableEntity> list = pager.getRecords();
551 552
        assertEquals(1, list.size());
552
        configurator.setDoTaxaByCommonNames(false);
553

  
554
        configurator.setDoTaxaByCommonNames(true);
553 555
        configurator.setDoMisappliedNames(true);
554 556
        configurator.setClassification(classificationService.load(UUID.fromString(CLASSIFICATION_UUID)));
555 557
        pager = taxonService.findTaxaAndNames(configurator);
556 558
        list = pager.getRecords();
557
        assertEquals(0, list.size());
559
        assertEquals(1, list.size());
558 560

  
559 561
    }
560 562

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)