Package ubic.gemma.persistence.util
Class BusinessKey
java.lang.Object
ubic.gemma.persistence.util.BusinessKey
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRestrictions
(Criteria queryObject, Gene2GOAssociation gene2GOAssociation) static void
addRestrictions
(Criteria queryObject, Contact contact) static void
addRestrictions
(Criteria queryObject, ArrayDesign arrayDesign) static void
addRestrictions
(Criteria queryObject, BioAssay bioAssay) static void
addRestrictions
(Criteria queryObject, BioMaterial bioMaterial) static void
addRestrictions
(Criteria queryObject, ExperimentalFactor experimentalFactor) 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.static void
addRestrictions
(Criteria queryObject, Chromosome chromosome) static void
addRestrictions
(Criteria queryObject, Gene gene, boolean stricter) static void
addRestrictions
(Criteria queryObject, Taxon taxon) static void
addRestrictions
(DetachedCriteria queryObject, DatabaseEntry databaseEntry) static void
attachCriteria
(Criteria queryObject, Characteristic ontologyEntry, String propertyName) Restricts the query to the provided OntologyEntry.static void
attachCriteria
(Criteria queryObject, DatabaseEntry databaseEntry, String propertyName) Restricts query to the given DatabaseEntry associationstatic void
attachCriteria
(Criteria queryObject, BioSequence bioSequence, String propertyName) Restricts the query to the provided BioSequence.static void
attachCriteria
(Criteria queryObject, Gene gene, String propertyName) Restricts the query to the provided Gene.static void
attachCriteria
(Criteria queryObject, PhysicalLocation physicalLocation, String attributeName) static void
attachCriteria
(Criteria queryObject, Taxon taxon, String propertyName) Restricts query to the given Taxon.static void
attachCriteria
(DetachedCriteria queryObject, DatabaseEntry databaseEntry, String attributeName) static void
static void
static void
checkKey
(BibliographicReference bibliographicReference) static void
checkKey
(Characteristic ontologyEntry) static void
checkKey
(DatabaseEntry accession) static void
checkKey
(ExternalDatabase externalDatabase) static void
checkKey
(DesignElementDataVector designElementDataVector) static void
checkKey
(ExpressionExperimentSubSet entity) static void
checkKey
(FactorValue factorValue) static void
static void
checkValidKey
(Gene2GOAssociation gene2GOAssociation) static void
checkValidKey
(DatabaseEntry databaseEntry) static void
checkValidKey
(Unit unit) static void
checkValidKey
(ArrayDesign arrayDesign) static void
checkValidKey
(ExperimentalFactor experimentalFactor) static void
checkValidKey
(BioSequence bioSequence) static void
checkValidKey
(Chromosome chromosome) static void
checkValidKey
(Gene gene) static void
checkValidKey
(GeneProduct geneProduct) static void
checkValidKey
(Taxon taxon) static Conjunction
createCharacteristicRestriction
(Characteristic characteristic) static void
createQueryObject
(Criteria queryObject, ExpressionExperimentSubSet entity) static void
createQueryObject
(Criteria queryObject, FactorValue factorValue) static void
createQueryObject
(Criteria queryObject, Gene gene) static void
createQueryObject
(Criteria queryObject, GeneProduct geneProduct) static Criteria
createQueryObject
(Session session, Characteristic ontologyEntry) static Criteria
createQueryObject
(Session session, Unit unit) static Criteria
createQueryObject
(Session session, ArrayDesign arrayDesign) static Criteria
createQueryObject
(Session session, BioAssay bioAssay) static Criteria
createQueryObject
(Session session, BioSequence bioSequence)
-
Constructor Details
-
BusinessKey
public BusinessKey()
-
-
Method Details
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
addRestrictions
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:
queryObject
- query objectbioSequence
- bio sequence
-
createCharacteristicRestriction
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
addRestrictions
-
attachCriteria
public static void attachCriteria(Criteria queryObject, BioSequence bioSequence, String propertyName) Restricts the query to the provided BioSequence.- Parameters:
queryObject
- query objectbioSequence
- The object used to create the criteriapropertyName
- Often this will be 'bioSequence'
-
attachCriteria
public static void attachCriteria(Criteria queryObject, Characteristic ontologyEntry, String propertyName) Restricts the query to the provided OntologyEntry.- Parameters:
queryObject
- query objectontologyEntry
- The object used to create the criteriapropertyName
- Often this will be 'ontologyEntry'
-
attachCriteria
public static void attachCriteria(Criteria queryObject, DatabaseEntry databaseEntry, String propertyName) Restricts query to the given DatabaseEntry association- Parameters:
queryObject
- query objectdatabaseEntry
- to matchpropertyName
- often "accession"
-
attachCriteria
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
Restricts query to the given Taxon.- Parameters:
queryObject
- query objecttaxon
- taxonpropertyName
- often "taxon"
-
attachCriteria
public static void attachCriteria(DetachedCriteria queryObject, DatabaseEntry databaseEntry, String attributeName) -
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
createQueryObject
-
checkKey
-
createQueryObject
-