From: <rv...@us...> - 2010-06-04 11:28:47
|
Revision: 716 http://treebase.svn.sourceforge.net/treebase/?rev=716&view=rev Author: rvos Date: 2010-06-04 11:28:42 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Adding interfaces and implementations of findByTB1LegacyId and findVariantByTB1LegacyId Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java 2010-06-04 11:27:31 UTC (rev 715) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java 2010-06-04 11:28:42 UTC (rev 716) @@ -150,4 +150,24 @@ } return result; } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.taxon.TaxonHome#findByTB1LegacyId(java.lang.Integer) + */ + public Taxon findByTB1LegacyId(Integer tb1LegacyId) { + Criteria c = getSession().createCriteria(Taxon.class); + c.add(Expression.eq("TB1LegacyId", tb1LegacyId)); + return (Taxon) c.uniqueResult(); + } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.taxon.TaxonHome#findVariantByTB1LegacyId(java.lang.Integer) + */ + public TaxonVariant findVariantByTB1LegacyId(Integer tb1LegacyId) { + Criteria c = getSession().createCriteria(TaxonVariant.class); + c.add(Expression.eq("TB1LegacyId", tb1LegacyId)); + return (TaxonVariant) c.uniqueResult(); + } } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java 2010-06-04 11:27:31 UTC (rev 715) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java 2010-06-04 11:28:42 UTC (rev 716) @@ -85,14 +85,30 @@ Taxon findByNcbiTaxId(Integer genbankId); /** - * Find the taxon that has the specified NCBI genBank ID + * Find the taxon that has the specified uBio namebank ID * * Throw an exception if there are multiple matches * - * @param genbankId + * @param nameBankId * @return the taxon object, or null if none is found * @author mjd 20080821 * @throws NonUniqueObjectException */ Taxon findByUBIOTaxId(Long nameBankId); + + /** + * Find the taxon that has the specified TreeBASE1 legacy ID + * + * @param tb1LegacyId + * @return the taxon object, or null if none is found + */ + Taxon findByTB1LegacyId(Integer tb1LegacyId); + + /** + * Find the taxonVariant that has the specified TreeBASE1 legacy ID + * + * @param tb1LegacyId + * @return the taxonVariant object, or null if none is found + */ + TaxonVariant findVariantByTB1LegacyId(Integer tb1LegacyId); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |