@Test public void testNodeBySciname() throws Exception { try(Transaction tx = dao.beginTx()) { assertNull(idb.nodeBySciname("Abies Mill.")); Node n = create("312", "Abies", "Abies Mill."); tx.success(); assertEquals(n, idb.nodeBySciname("Abies Mill.")); assertNull(idb.nodeBySciname("Abies")); } }
protected Node nodeBySciname(String sciname) throws NotUniqueException { try { return Iterators .singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.SCIENTIFIC_NAME, sciname)); } catch (NoSuchElementException e) { throw new NotUniqueException(sciname, "Scientific name not unique: " + sciname); } }
ImportDb { protected Node nodeBySciname(String sciname) throws NotUniqueException { try { return Iterators .singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.SCIENTIFIC_NAME, sciname)); } catch (NoSuchElementException e) { throw new NotUniqueException(sciname, "Scientific name not unique: " + sciname); } } }
ImportDb { protected Node nodeBySciname(String sciname) throws NotUniqueException { try { return Iterators .singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.SCIENTIFIC_NAME, sciname)); } catch (NoSuchElementException e) { throw new NotUniqueException(sciname, "Scientific name not unique: " + sciname); } } ImportDb(UUID datasetKey, UsageDao dao); }
ImportDb { protected Node nodeBySciname(String sciname) throws NotUniqueException { try { return Iterators .singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.SCIENTIFIC_NAME, sciname)); } catch (NoSuchElementException e) { throw new NotUniqueException(sciname, "Scientific name not unique: " + sciname); } } ImportDb(UUID datasetKey, UsageDao dao); UUID getDatasetKey(); }
ImportDb { protected Node nodeBySciname(String sciname) throws NotUniqueException { try { return Iterators .singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.SCIENTIFIC_NAME, sciname)); } catch (NoSuchElementException e) { throw new NotUniqueException(sciname, "Scientific name not unique: " + sciname); } } ImportDb(UUID datasetKey, UsageDao dao); UUID getDatasetKey();  }