|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nci.caarray.services.util.db.ManagerDB
gov.nih.nci.caarray.services.biomaterial.BioMaterialManagerDB
public final class BioMaterialManagerDB
Field Summary |
---|
Fields inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB |
---|
CASCADE_LINK, CASCADE_NONE, CASCADE_OBJECT, ID_UNSET |
Constructor Summary | |
---|---|
BioMaterialManagerDB()
Default Constructor |
Method Summary | |
---|---|
long |
addBioSample(BioSample bioSample)
|
long |
addBioSource(BioSource bioSource)
|
long |
addLabeledExtract(LabeledExtract extract)
|
long |
addTreatment(long bioMaterialId,
java.lang.Class bioMaterialClass,
Treatment treatment)
Adds the specified treatment to the specified BioMaterial. |
void |
clearBiomaterialFromCache(BioMaterial bioMaterialToClear)
Recursively removes a biomaterial and all it's parents from the cache, to be used after copying to make sure you get the latest copy from the database |
void |
close()
Close database connection. |
long |
copyBioMaterial(BioMaterial bioMaterialToCopy,
java.lang.Class sourceBioMaterialClass,
java.lang.String duplicateBioMaterialName,
java.lang.String owner)
Recursively copies the whole biomaterial tree Move heirarchicaly fromtop down. |
long |
copyBioMaterial(long bioMaterialToCopyId,
java.lang.Class sourceBioMaterialClass,
java.lang.String duplicateBioMaterialName,
java.lang.String owner)
|
void |
deleteBioSample(long bioSampleId)
|
void |
deleteBioSource(long bioSourceId)
|
void |
deleteLabeledExtract(long extractId)
|
void |
deleteTreatmentFromBioMaterial(long bioMaterialId,
long treatmentId)
|
boolean |
doesBioMaterialHaveTreatment(long bioMaterialId,
long treatmentId)
|
long |
duplicateBioMaterial(long sourceBioMaterialId,
java.lang.Class sourceBioMaterialClass,
java.lang.String duplicateBioMaterialName)
|
BioMaterial |
getBioMaterial(long id)
Retrieve a BioMaterial |
BioMaterial[] |
getBioMaterials(BioMaterialSearchCriteria criteria)
|
protected BioMaterial[] |
getBioMaterials(BioMaterialSearchCriteria criteria,
java.lang.Class objectClass)
Get available BioMaterials. |
BioSample |
getBioSample(long id)
Retrieve a BioSample |
BioSample |
getBioSampleByTreatment(long treatmentId)
Retrieve the BioSample which has a Treatment that matches the specified treatmentId. |
BioSample[] |
getBioSamples(BioMaterialSearchCriteria criteria)
|
BioSource |
getBioSource(long id)
Retrieve a BioSource |
BioSource[] |
getBioSources(BioMaterialSearchCriteria criteria)
|
OntologyEntry[] |
getCharacteristicsFromSourceBioSourcesOf(long bioMaterialId,
java.lang.Class objectClass)
Retrieves a list of distinct characteristics of the source BioSource 's
that are used to produce the specified product BioSample or
LabeledExtract . |
LabeledExtract |
getLabeledExtract(long id)
Retrieve a LabeledExtract Object |
LabeledExtract[] |
getLabeledExtracts(BioMaterialSearchCriteria criteria)
|
BioMaterial[] |
getTopMostSourceBioMaterials(BioMaterial bioMaterial)
Gets the parents of the specified bio material, which are in most cases bio sources. |
Treatment |
getTreatment(long id)
|
Treatment[] |
getTreatments(long bioMaterialId)
|
static void |
main(java.lang.String[] args)
Used for test only. |
void |
updateBioMaterialCharacteristics(long bioMaterialId,
java.lang.Class bioMaterialClass,
OntologyEntry[] characteristics)
Save the specified BioMaterial with the specified
characteristics. |
void |
updateBioSample(BioSample bioSample)
|
void |
updateBioSource(BioSource bioSource)
Update a BioSource |
void |
updateLabeledExtract(LabeledExtract extract)
|
void |
updateTreatment(Treatment treatment,
boolean updateProtocolApplication)
|
Methods inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB |
---|
clearCache, countObjects, countObjects, deleteByQuery, deleteMtoNRelation, deleteObject, deleteObject, deleteObject, deleteObjectByQuery, exists, getIdentifiable, getObject, getObject, getObject, getObject, getObject, getObject, getObjectIterator, getObjectIterator, getObjects, getObjects, getObjects, getPersistenceBroker, getSqlInLimit, insertMtoNRelation, insertMtoNRelation, insertObject, insertObject, link, link, removeFromCache, retrieveReference, retrieveReferences, setCascadeDelete, setCascadeRetrieve, setCascadeStore, storeObject, storeObject, unlink, unlink, updateObject, updateObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BioMaterialManagerDB()
Method Detail |
---|
public BioMaterial getBioMaterial(long id) throws java.lang.Exception
id
-
ObjectNotExistException,
- DBException
java.lang.Exception
public BioSource getBioSource(long id) throws java.lang.Exception
id
-
ObjectNotExistException,
- DBException
java.lang.Exception
public BioSample getBioSample(long id) throws java.lang.Exception
id
-
ObjectNotExistException,
- DBException
java.lang.Exception
public BioSample getBioSampleByTreatment(long treatmentId) throws java.lang.Exception
treatmentId
-
ObjectNotExistException
DBException
java.lang.Exception
public LabeledExtract getLabeledExtract(long id) throws java.lang.Exception
id
-
ObjectNotExistException,
- DBException
java.lang.Exception
public void updateBioSource(BioSource bioSource) throws java.lang.Exception
BioSource
-
ObjectNotExistException,
- DBException
java.lang.Exception
public void updateBioSample(BioSample bioSample) throws java.lang.Exception
java.lang.Exception
public void updateLabeledExtract(LabeledExtract extract) throws java.lang.Exception
java.lang.Exception
public long addBioSource(BioSource bioSource) throws java.lang.Exception
java.lang.Exception
public long addBioSample(BioSample bioSample) throws java.lang.Exception
java.lang.Exception
public long addLabeledExtract(LabeledExtract extract) throws java.lang.Exception
java.lang.Exception
public void updateBioMaterialCharacteristics(long bioMaterialId, java.lang.Class bioMaterialClass, OntologyEntry[] characteristics) throws java.lang.Exception
BioMaterial
with the specified
characteristics. The saving implies adding, updating, or deleting
characterstics and is done as follows:
BioMaterial
. Re-associated characteristics
are assumed to contain the new value and they are updated. For disassociated
characteristics, both the association and the characteristics themselves are
to be deleted.
BioMaterial
.
For disassociated reusable characteristics, only the link from the
BioMaterial
to it is deleted.
bioMaterialId
- - The ID of the BioMaterial
associated
with the specified characteristics.characteristics
- - The characteristics to be updated.
java.lang.Exception
public void updateTreatment(Treatment treatment, boolean updateProtocolApplication) throws java.lang.Exception
treatment
- updateProtocolApplication
- - True to indicate that the associated
protocolApplication
(s) should also be updated. False to ignore.
ObjectNotExistException
DBException
java.lang.Exception
public boolean doesBioMaterialHaveTreatment(long bioMaterialId, long treatmentId) throws java.lang.Exception
java.lang.Exception
public long addTreatment(long bioMaterialId, java.lang.Class bioMaterialClass, Treatment treatment) throws java.lang.Exception
bioMaterialId
- treatment
-
ObjectNotExistException
InsertObjectException
DBException
java.lang.Exception
public long duplicateBioMaterial(long sourceBioMaterialId, java.lang.Class sourceBioMaterialClass, java.lang.String duplicateBioMaterialName) throws java.lang.Exception
java.lang.Exception
public long copyBioMaterial(long bioMaterialToCopyId, java.lang.Class sourceBioMaterialClass, java.lang.String duplicateBioMaterialName, java.lang.String owner) throws java.lang.Exception
java.lang.Exception
public void clearBiomaterialFromCache(BioMaterial bioMaterialToClear)
bioMaterialToClear
- public long copyBioMaterial(BioMaterial bioMaterialToCopy, java.lang.Class sourceBioMaterialClass, java.lang.String duplicateBioMaterialName, java.lang.String owner) throws java.lang.Exception
id
-
ObjectNotExistException
DBException
java.lang.Exception
public Treatment getTreatment(long id) throws java.lang.Exception
id
-
java.lang.Exception
public Treatment[] getTreatments(long bioMaterialId) throws java.lang.Exception
id
-
java.lang.Exception
public void deleteTreatmentFromBioMaterial(long bioMaterialId, long treatmentId) throws java.lang.Exception
bioSampleId
- treatmentId
-
ObjectNotExistException
DBException
ObjectInUseException
- - When the treatment is the only one
remaining.
java.lang.Exception
public void close()
ManagerDB
close
in class ManagerDB
public BioMaterial[] getTopMostSourceBioMaterials(BioMaterial bioMaterial)
material
-
public OntologyEntry[] getCharacteristicsFromSourceBioSourcesOf(long bioMaterialId, java.lang.Class objectClass) throws java.lang.Exception
BioSource
's
that are used to produce the specified product BioSample
or
LabeledExtract
.
bioMaterialId
- - The ID of a BioSample
or
LabeledExtract
.
java.lang.Exception
public BioMaterial[] getBioMaterials(BioMaterialSearchCriteria criteria)
public BioSource[] getBioSources(BioMaterialSearchCriteria criteria)
public BioSample[] getBioSamples(BioMaterialSearchCriteria criteria)
public LabeledExtract[] getLabeledExtracts(BioMaterialSearchCriteria criteria)
protected BioMaterial[] getBioMaterials(BioMaterialSearchCriteria criteria, java.lang.Class objectClass)
public void deleteBioSource(long bioSourceId) throws java.lang.Exception
java.lang.Exception
public void deleteBioSample(long bioSampleId) throws java.lang.Exception
java.lang.Exception
public void deleteLabeledExtract(long extractId) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |