Package ubic.gemma.persistence.util
Class BusinessKey
- java.lang.Object
-
- ubic.gemma.persistence.util.BusinessKey
-
public class BusinessKey extends Object
Methods to test business-key-related issues on objects. The 'checkValidKey' methods can be used to check whether an object has the required business key values filled in. An exception is thrown if they don't. This class contains some important code that determines our rules for how entities are detected as being the same as another (in queries from the database; this is on top of basic 'equals', but should be compatible).- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description BusinessKey()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddRestrictions(Criteria queryObject, Gene2GOAssociation gene2GOAssociation)static voidaddRestrictions(Criteria queryObject, Contact contact)static voidaddRestrictions(Criteria queryObject, Characteristic characteristic)static voidaddRestrictions(Criteria queryObject, QuantitationType quantitationType)static voidaddRestrictions(Criteria queryObject, ArrayDesign arrayDesign)static voidaddRestrictions(Criteria queryObject, BioAssay bioAssay)static voidaddRestrictions(Criteria queryObject, BioMaterial bioMaterial)static voidaddRestrictions(Criteria queryObject, ExperimentalFactor experimentalFactor)static voidaddRestrictions(Criteria queryObject, BioSequence bioSequence)Note: The finder has to do the additional checking for equality of sequence and/or database entry - we don't know until we get the sequences.static voidaddRestrictions(Criteria queryObject, Chromosome chromosome)static voidaddRestrictions(Criteria queryObject, Gene gene, boolean stricter)static voidaddRestrictions(Criteria queryObject, Taxon taxon)static voidaddRestrictions(DetachedCriteria queryObject, DatabaseEntry databaseEntry)static voidattachCriteria(Criteria queryObject, Characteristic ontologyEntry, String propertyName)Restricts the query to the provided OntologyEntry.static voidattachCriteria(Criteria queryObject, DatabaseEntry databaseEntry, String propertyName)Restricts query to the given DatabaseEntry associationstatic voidattachCriteria(Criteria queryObject, BioSequence bioSequence, String propertyName)Restricts the query to the provided BioSequence.static voidattachCriteria(Criteria queryObject, Gene gene, String propertyName)Restricts the query to the provided Gene.static voidattachCriteria(Criteria queryObject, PhysicalLocation physicalLocation, String attributeName)static voidattachCriteria(Criteria queryObject, Taxon taxon, String propertyName)Restricts query to the given Taxon.static voidattachCriteria(DetachedCriteria queryObject, DatabaseEntry databaseEntry, String attributeName)static voidcheckKey(Contact contact)static voidcheckKey(User user)static voidcheckKey(BibliographicReference bibliographicReference)static voidcheckKey(Characteristic ontologyEntry)static voidcheckKey(DatabaseEntry accession)static voidcheckKey(ExternalDatabase externalDatabase)static voidcheckKey(DesignElementDataVector designElementDataVector)static voidcheckKey(ExpressionExperimentSubSet entity)static voidcheckKey(FactorValue factorValue)static voidcheckKey(Gene gene)static voidcheckValidKey(Gene2GOAssociation gene2GOAssociation)static voidcheckValidKey(DatabaseEntry databaseEntry)static voidcheckValidKey(LocalFile localFile)static voidcheckValidKey(Unit unit)static voidcheckValidKey(ArrayDesign arrayDesign)static voidcheckValidKey(ExperimentalFactor experimentalFactor)static voidcheckValidKey(BioSequence bioSequence)static voidcheckValidKey(Chromosome chromosome)static voidcheckValidKey(Gene gene)static voidcheckValidKey(GeneProduct geneProduct)static voidcheckValidKey(Taxon taxon)static voidcreateQueryObject(Criteria queryObject, ExpressionExperimentSubSet entity)static voidcreateQueryObject(Criteria queryObject, FactorValue factorValue)static voidcreateQueryObject(Criteria queryObject, Gene gene)static voidcreateQueryObject(Criteria queryObject, GeneProduct geneProduct)static CriteriacreateQueryObject(Session session, Characteristic ontologyEntry)static CriteriacreateQueryObject(Session session, Unit unit)static CriteriacreateQueryObject(Session session, ArrayDesign arrayDesign)static CriteriacreateQueryObject(Session session, BioAssay bioAssay)static CriteriacreateQueryObject(Session session, BioSequence bioSequence)
-
-
-
Method Detail
-
addRestrictions
public static void addRestrictions(Criteria queryObject, ArrayDesign arrayDesign)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, BioMaterial bioMaterial)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, BioSequence bioSequence)
Note: The finder has to do the additional checking for equality of sequence and/or database entry - we don't know until we get the sequences. Due to the following issues:- Sometimes the sequence in the database lacks the DatabaseEntry
- Sometimes the old entry lacks the actual sequence (ATCG..)
- Parameters:
bioSequence- bio sequencequeryObject- query object
-
addRestrictions
public static void addRestrictions(Criteria queryObject, Characteristic characteristic)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, Chromosome chromosome)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, ExperimentalFactor experimentalFactor)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, Gene gene, boolean stricter)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, Gene2GOAssociation gene2GOAssociation)
-
addRestrictions
public static void addRestrictions(Criteria queryObject, QuantitationType quantitationType)
-
addRestrictions
public static void addRestrictions(DetachedCriteria queryObject, DatabaseEntry databaseEntry)
-
attachCriteria
public static void attachCriteria(Criteria queryObject, BioSequence bioSequence, String propertyName)
Restricts the query to the provided BioSequence.- Parameters:
bioSequence- The object used to create the criteriapropertyName- Often this will be 'bioSequence'queryObject- query object
-
attachCriteria
public static void attachCriteria(Criteria queryObject, Characteristic ontologyEntry, String propertyName)
Restricts the query to the provided OntologyEntry.- Parameters:
ontologyEntry- The object used to create the criteriapropertyName- Often this will be 'ontologyEntry'queryObject- query object
-
attachCriteria
public static void attachCriteria(Criteria queryObject, DatabaseEntry databaseEntry, String propertyName)
Restricts query to the given DatabaseEntry association- Parameters:
databaseEntry- to matchpropertyName- often "accession"queryObject- query object
-
attachCriteria
public static void attachCriteria(Criteria queryObject, Gene gene, String propertyName)
Restricts the query to the provided Gene.- Parameters:
queryObject- query objectgene- genepropertyName- property name
-
attachCriteria
public static void attachCriteria(Criteria queryObject, PhysicalLocation physicalLocation, String attributeName)
-
attachCriteria
public static void attachCriteria(Criteria queryObject, Taxon taxon, String propertyName)
Restricts query to the given Taxon.- Parameters:
propertyName- often "taxon"queryObject- query objecttaxon- taxon
-
attachCriteria
public static void attachCriteria(DetachedCriteria queryObject, DatabaseEntry databaseEntry, String attributeName)
-
checkKey
public static void checkKey(BibliographicReference bibliographicReference)
-
checkKey
public static void checkKey(Characteristic ontologyEntry)
-
checkKey
public static void checkKey(Contact contact)
-
checkKey
public static void checkKey(DatabaseEntry accession)
-
checkKey
public static void checkKey(DesignElementDataVector designElementDataVector)
-
checkKey
public static void checkKey(ExternalDatabase externalDatabase)
-
checkKey
public static void checkKey(FactorValue factorValue)
-
checkKey
public static void checkKey(Gene gene)
-
checkKey
public static void checkKey(User user)
-
checkValidKey
public static void checkValidKey(ArrayDesign arrayDesign)
-
checkValidKey
public static void checkValidKey(BioSequence bioSequence)
-
checkValidKey
public static void checkValidKey(Chromosome chromosome)
-
checkValidKey
public static void checkValidKey(DatabaseEntry databaseEntry)
-
checkValidKey
public static void checkValidKey(ExperimentalFactor experimentalFactor)
-
checkValidKey
public static void checkValidKey(Gene gene)
-
checkValidKey
public static void checkValidKey(Gene2GOAssociation gene2GOAssociation)
-
checkValidKey
public static void checkValidKey(GeneProduct geneProduct)
-
checkValidKey
public static void checkValidKey(Taxon taxon)
-
checkValidKey
public static void checkValidKey(LocalFile localFile)
-
checkValidKey
public static void checkValidKey(Unit unit)
-
createQueryObject
public static void createQueryObject(Criteria queryObject, FactorValue factorValue)
-
createQueryObject
public static void createQueryObject(Criteria queryObject, GeneProduct geneProduct)
-
createQueryObject
public static Criteria createQueryObject(Session session, ArrayDesign arrayDesign)
-
createQueryObject
public static Criteria createQueryObject(Session session, BioSequence bioSequence)
-
createQueryObject
public static Criteria createQueryObject(Session session, Characteristic ontologyEntry)
-
checkKey
public static void checkKey(ExpressionExperimentSubSet entity)
-
createQueryObject
public static void createQueryObject(Criteria queryObject, ExpressionExperimentSubSet entity)
-
-