gov.nih.nci.caarray.domain.sample
Class AbstractBioMaterial

java.lang.Object
  extended by gov.nih.nci.caarray.domain.AbstractCaArrayObject
      extended by gov.nih.nci.caarray.domain.AbstractCaArrayEntity
          extended by gov.nih.nci.caarray.domain.project.AbstractExperimentDesignNode
              extended by gov.nih.nci.caarray.domain.sample.AbstractBioMaterial
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, ProtocolApplicable, java.io.Serializable
Direct Known Subclasses:
Extract, LabeledExtract, Sample, Source

@UniqueConstraint(fields={@UniqueConstraintField(name="externalId"),@UniqueConstraintField(name="experiment",nullsEqual=false)},
                  generateDDLConstraint=false,
                  message="{biomaterial.externalId.uniqueConstraint}")
public abstract class AbstractBioMaterial
extends AbstractExperimentDesignNode

AbstractBiomaterial represents a biomaterial at some stage prior to being hybridized to an array.

Author:
dkokotov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
CAARRAY_LSID_AUTHORITY, CAARRAY_LSID_NAMESPACE
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
DEFAULT_BATCH_SIZE, DEFAULT_STRING_COLUMN_SIZE, LARGE_TEXT_FIELD_LENGTH
 
Constructor Summary
AbstractBioMaterial()
           
 
Method Summary
 void addProtocolApplication(ProtocolApplication protocolApplication)
          Add the given protocol application to the protocol applications of this.
 void clearProtocolApplications()
          Remove all protocol applications of this.
 java.util.Set<CaArrayFile> getAllDataFiles()
           The data files related to this biomaterial is the set of files that is related to at least one hybridization that is related to this biomaterial (@see getRelatedHybs()).
 Term getCellType()
           
 AbstractCharacteristic getCharacteristic(java.lang.String categoryName)
          Return the characteristic with given category name in this biomaterial.
 java.util.Set<AbstractCharacteristic> getCharacteristics()
          Gets the characteristics.
 java.util.Set<AbstractCharacteristic> getCharacteristics(Category category)
          Return the characteristics with given category in this biomaterial.
 java.lang.String getDescription()
          Gets the description.
 Term getDiseaseState()
           
 Experiment getExperiment()
          Get the experiment to which this node belongs.
 java.lang.String getExternalId()
           
 java.util.Date getLastModifiedDataTime()
           
 Term getMaterialType()
          Gets the materialType.
 java.lang.String getName()
          Gets the name.
 Organism getOrganism()
           
 java.util.List<ProtocolApplication> getProtocolApplications()
          
 java.util.Set<Hybridization> getRelatedHybridizations()
           
protected  java.util.Map<ExperimentOntologyCategory,Term> getSpecialCharacteristics()
          Returns the characteristics that are handled specially and have their own fields in AbstractBioMaterial or one of its subclasses, rather than being placed in the general characteristics collection.
 Term getTissueSite()
           
 void merge(AbstractExperimentDesignNode node)
          Merges another AbstractExperimentDesignNode into this one.
 void propagateLastModifiedDataTime(java.util.Date lastModifiedDate)
          Propagates the last modified data time up the chain.
 void setCellType(Term cellType)
           
 void setDescription(java.lang.String descriptionVal)
          Sets the description.
 void setDiseaseState(Term diseaseState)
           
 void setExperiment(Experiment experiment)
           
 void setExternalId(java.lang.String externalId)
           
 void setLastModifiedDataTime(java.util.Date lastModifiedDataTime)
           
 void setMaterialType(Term materialTypeVal)
          Sets the materialType.
 void setName(java.lang.String nameVal)
          Sets the name.
 void setOrganism(Organism organism)
           
 void setTissueSite(Term tissueSite)
           
 java.lang.String toString()
          
 
Methods inherited from class gov.nih.nci.caarray.domain.project.AbstractExperimentDesignNode
addDirectPredecessor, addDirectSuccessor, doAddDirectPredecessor, doAddDirectSuccessor, getCharacteristicsRecursively, getDirectPredecessors, getDirectSuccessors, getNodeType, getPredecessorsOfType, getSuccessorsOfType
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
getLsid, getLsidAuthority, getLsidNamespace, getLsidObjectId, setLsid, setLsid, setLsidForEntity
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
equals, getCaBigId, getId, getPostLoadSecurityPolicies, getRemoteApiSecurityPolicies, hashCode, setCaBigId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractBioMaterial

public AbstractBioMaterial()
Method Detail

getExperiment

public Experiment getExperiment()
Get the experiment to which this node belongs.

Specified by:
getExperiment in class AbstractExperimentDesignNode
Returns:
the experiment to which this node belongs

setExperiment

public void setExperiment(Experiment experiment)
Parameters:
experiment - the experiment to set

getTissueSite

public Term getTissueSite()
Returns:
the tissueSite

setTissueSite

public void setTissueSite(Term tissueSite)
Parameters:
tissueSite - the tissueSite to set

getMaterialType

public Term getMaterialType()
Gets the materialType.

Returns:
the materialType

setMaterialType

public void setMaterialType(Term materialTypeVal)
Sets the materialType.

Parameters:
materialTypeVal - the materialType

getCellType

public Term getCellType()
Returns:
the cellType

setCellType

public void setCellType(Term cellType)
Parameters:
cellType - the cellType to set

getDiseaseState

public Term getDiseaseState()
Returns:
the diseaseState

setDiseaseState

public void setDiseaseState(Term diseaseState)
Parameters:
diseaseState - the diseaseState to set

getName

@NotNull
@Length(min=1,
        max=254)
public java.lang.String getName()
Gets the name.

Specified by:
getName in class AbstractExperimentDesignNode
Returns:
the name

setName

public void setName(java.lang.String nameVal)
Sets the name.

Parameters:
nameVal - the name

getDescription

@Length(max=2000)
public java.lang.String getDescription()
Gets the description.

Returns:
the description

setDescription

public void setDescription(java.lang.String descriptionVal)
Sets the description.

Parameters:
descriptionVal - the description

getExternalId

@Length(max=254)
public java.lang.String getExternalId()
Returns:
the externalId

setExternalId

public void setExternalId(java.lang.String externalId)
Parameters:
externalId - the externalId to set

getCharacteristics

public java.util.Set<AbstractCharacteristic> getCharacteristics()
Gets the characteristics.

Returns:
the characteristics

getLastModifiedDataTime

public java.util.Date getLastModifiedDataTime()
Returns:
the date when the data of this sample was last modified.

setLastModifiedDataTime

public void setLastModifiedDataTime(java.util.Date lastModifiedDataTime)
Parameters:
lastModifiedDataTime - the lastDataModificationDate to set.

propagateLastModifiedDataTime

public void propagateLastModifiedDataTime(java.util.Date lastModifiedDate)
Propagates the last modified data time up the chain.

Overrides:
propagateLastModifiedDataTime in class AbstractExperimentDesignNode
Parameters:
lastModifiedDate - the lastDataModificationDate to set.

getCharacteristic

public AbstractCharacteristic getCharacteristic(java.lang.String categoryName)
Return the characteristic with given category name in this biomaterial. If multiple characteristics have the same category name, return one at random. If there is none, return null.

Parameters:
categoryName - name of category for which to find a characteristic.
Returns:
the characteristic with given category name or null if there is none.

getCharacteristics

public java.util.Set<AbstractCharacteristic> getCharacteristics(Category category)
Return the characteristics with given category in this biomaterial.

Overrides:
getCharacteristics in class AbstractExperimentDesignNode
Parameters:
category - category
Returns:
the characteristics with given category.

getSpecialCharacteristics

protected java.util.Map<ExperimentOntologyCategory,Term> getSpecialCharacteristics()
Returns the characteristics that are handled specially and have their own fields in AbstractBioMaterial or one of its subclasses, rather than being placed in the general characteristics collection. These are returned as a map, with keys being category constants defining the category of the special characteristic, and the values being the Term values of the characteristic. For AbstractBioMaterial, this will return a map with four entries: Subclasses can override this method to add additional entries if they have other characteristics that they store directly.

Returns:
the map of special characterstics as described above

getProtocolApplications

public java.util.List<ProtocolApplication> getProtocolApplications()

Returns:
the ProtocolApplications representing the protocols applied to this.

addProtocolApplication

public void addProtocolApplication(ProtocolApplication protocolApplication)
Add the given protocol application to the protocol applications of this.

Parameters:
protocolApplication - the protocol application to add

clearProtocolApplications

public void clearProtocolApplications()
Remove all protocol applications of this.


getOrganism

public Organism getOrganism()
Returns:
the organism

setOrganism

public void setOrganism(Organism organism)
Parameters:
organism - the organism to set

getRelatedHybridizations

public java.util.Set<Hybridization> getRelatedHybridizations()
Returns:
the set of hybridizations related to this biomaterial (via the biomaterial chain)

getAllDataFiles

public java.util.Set<CaArrayFile> getAllDataFiles()
The data files related to this biomaterial is the set of files that is related to at least one hybridization that is related to this biomaterial (@see getRelatedHybs()).

Specified by:
getAllDataFiles in class AbstractExperimentDesignNode
Returns:
all the data files related to this node.

merge

public void merge(AbstractExperimentDesignNode node)
Merges another AbstractExperimentDesignNode into this one. For simple properties, the other node's value will only be used if the corresponding value in this is null. For unordered Collections, the collections will be merged. For ordered Lists, the specific behavior will be determined by the subclass. The behavior for other types of properties is dependent on subclasses but should be consistent with the behavior of simple properties.

Most of the information will actually be moved from node to this in preparation for deleting node.

Overrides:
merge in class AbstractExperimentDesignNode
Parameters:
node - node to merge into this

toString

public java.lang.String toString()

Overrides:
toString in class AbstractCaArrayObject