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.
Hibernate 6 port: the Criteria-based API has been replaced with JPA Criteria. Each entity type exposes a
matches(...) helper that contributes predicates to a query the caller already built (so the caller stays
in control of read-only/flush-mode hints), and a convenience find(Session, X) that wraps the whole thing.
The checkKey / checkValidKey methods are unchanged.
- Author:
- pavlidis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidattachBioSequence(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ?> parent, String propertyName, BioSequence bioSequence, List<jakarta.persistence.criteria.Predicate> preds) Restricts a parent query so that propertypropertyNamematches a BioSequence by business key.static voidattachDatabaseEntry(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ?> parent, String propertyName, DatabaseEntry databaseEntry, List<jakarta.persistence.criteria.Predicate> preds) Restrict a parent query so a DatabaseEntry-typed property atpropertyNamematches by business key.static voidstatic voidstatic voidcheckKey(BibliographicReference bibliographicReference) static voidcheckKey(Characteristic ontologyEntry) static voidcheckKey(DatabaseEntry accession) static voidcheckKey(ExternalDatabase externalDatabase) static voidcheckKey(QuantitationType quantitationType) static voidcheckKey(BioAssayDimension bioAssayDimension) static voidcheckKey(DesignElementDataVector designElementDataVector) static voidcheckKey(ExpressionExperimentSubSet entity) static voidcheckKey(FactorValue factorValue) static voidstatic voidcheckValidKey(Gene2GOAssociation gene2GOAssociation) static voidcheckValidKey(DatabaseEntry databaseEntry) 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 Gene2GOAssociationfind(Session session, Gene2GOAssociation g2g) static Contactstatic Characteristicfind(Session session, Characteristic ontologyEntry) static Unitstatic QuantitationTypefind(Session session, QuantitationType qt) Find an existingQuantitationTypewhose full set of identifying fields equals the input's.static ArrayDesignfind(Session session, ArrayDesign arrayDesign) static BioAssaystatic BioAssayDimensionfind(Session session, BioAssayDimension bioAssayDimension) static BioMaterialfind(Session session, BioMaterial bioMaterial) static ExperimentalFactorfind(Session session, ExperimentalFactor experimentalFactor) static ExpressionExperimentSubSetfind(Session session, ExpressionExperimentSubSet entity) static FactorValuefind(Session session, FactorValue factorValue) static BioSequencefind(Session session, BioSequence bioSequence) static Chromosomefind(Session session, Chromosome chromosome) Find an existingChromosomeby its business key (name + taxon, optionally tightened by assemblyDatabase + sequence when present on the input).static Genestatic GeneProductfind(Session session, GeneProduct geneProduct) static Taxonstatic List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ? extends Contact> from, Contact contact) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ? extends Characteristic> from, Characteristic ontologyEntry) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Gene2GOAssociation> from, Gene2GOAssociation g2g) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, QuantitationType> from, QuantitationType qt) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ArrayDesign> from, ArrayDesign arrayDesign) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, BioAssay> from, BioAssay bioAssay) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, BioMaterial> from, BioMaterial bioMaterial) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ExperimentalFactor> from, ExperimentalFactor experimentalFactor) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, BioSequence> from, BioSequence bioSequence) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Chromosome> from, Chromosome chromosome) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Gene> from, Gene gene, boolean stricter) static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Taxon> from, Taxon taxon)
-
Constructor Details
-
BusinessKey
public BusinessKey()
-
-
Method Details
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ArrayDesign> from, ArrayDesign arrayDesign) -
find
-
matches
-
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, BioMaterial> from, BioMaterial bioMaterial) -
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, BioSequence> from, BioSequence bioSequence) -
find
-
attachBioSequence
public static void attachBioSequence(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ?> parent, String propertyName, BioSequence bioSequence, List<jakarta.persistence.criteria.Predicate> preds) Restricts a parent query so that propertypropertyNamematches a BioSequence by business key. Used by e.g. BlatResult / BlatAssociation finders. -
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Chromosome> from, Chromosome chromosome) -
find
Find an existingChromosomeby its business key (name + taxon, optionally tightened by assemblyDatabase + sequence when present on the input).- Throws:
IllegalArgumentException- if the chromosome lacks a name or a taxonNonUniqueResultException- if more than one row matches the key
-
matches
-
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ExperimentalFactor> from, ExperimentalFactor experimentalFactor) -
find
-
find
-
matches
-
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, Gene2GOAssociation> from, Gene2GOAssociation g2g) -
find
-
find
-
matches
-
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ? extends Characteristic> from, Characteristic ontologyEntry) -
find
-
find
-
find
-
matches
public static List<jakarta.persistence.criteria.Predicate> matches(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, QuantitationType> from, QuantitationType qt) -
find
Find an existingQuantitationTypewhose full set of identifying fields equals the input's.- Throws:
IllegalArgumentException- if the QT lacks a nameNonUniqueResultException- if more than one row matches the key
-
find
@Nullable public static BioAssayDimension find(Session session, BioAssayDimension bioAssayDimension) -
checkKey
-
checkKey
-
attachDatabaseEntry
public static void attachDatabaseEntry(jakarta.persistence.criteria.CriteriaBuilder cb, jakarta.persistence.criteria.From<?, ?> parent, String propertyName, DatabaseEntry databaseEntry, List<jakarta.persistence.criteria.Predicate> preds) Restrict a parent query so a DatabaseEntry-typed property atpropertyNamematches by business key. Used by callers that build a query on a different entity referencing the DatabaseEntry. -
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-
checkValidKey
-