uk.ac.cisban.rod.dao
Class Persist

java.lang.Object
  extended by uk.ac.cisban.rod.dao.Persist

public class Persist
extends java.lang.Object

For persisting objects to the database.

Since:
06-Oct-2009, 17:13:07
Author:
Morgan Taschuk

Constructor Summary
Persist(DAO dao)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Exception> addPlateTreatments(java.util.List<java.lang.String> barcodes, java.util.Date date, java.lang.Long treatmentCvId)
           
 java.util.Collection<PlateTreatment> addPlateTreatments(java.lang.String barcode, java.util.ArrayList<java.util.Date> dates, java.util.ArrayList<java.lang.String> treatmentNames)
           
 ActionApplication newActionApplication(javax.jdo.PersistenceManager pm, ActionCV actionCV, ProtocolApplication protocolApp, PlateCV input, PlateCV output)
           
 ActionApplication newActionApplication(java.lang.String actionRefId, java.lang.Long protocolAppId)
           
 ActionCV newActionCV(java.lang.String protocolID, java.lang.String identifier, int actionOrdinal, java.lang.String actionText, java.lang.String name, java.lang.String subProtocolID, boolean repeatable)
           
 BackgroundMutationCV newBackgroundMutationCV(java.lang.String name, java.lang.String description)
          Persists a new BackgroundMutationCV.
 Barcode newBarcode(javax.jdo.PersistenceManager pm, java.lang.String barcodeValue)
           
 EquipmentCV newEquipmentCV(java.lang.String identifier, java.lang.String make, java.lang.String model, java.lang.String name, java.lang.String serialNumber)
           
 Experiment newExperiment(java.lang.String name, java.lang.String description, java.lang.Long protocolCVId, boolean complete, java.lang.Long[] mpsSt)
           
 FeatureCV newFeatureCV(java.lang.String featureName, java.lang.String description)
           
 Image newImage(java.lang.String uri, ImageCV imageCV, Barcode plate, double threshold, int tileDimX, int tileDimY)
           
 ImageCV newImageCV(java.lang.String description)
           
 ImageResult newImageResult(int area, int trimmedArea, int intensity, int edgePixels, ImageSpot imageSpot, FeatureCV featureCV, Image referencedImage, int xOffset, int yOffset, java.awt.Color colonyColor, java.awt.Color backgroundColor, int edgeLength)
           
 ImageTransformation newImageTransformation(java.lang.String parameters, Image inputImage, Image outputImage, ImageTransformationCV imageTransformationCV)
           
 ImageTransformationCV newImageTransformationCV(java.lang.String name)
           
 Masterplate newMasterplate(java.lang.String barcodeSt, java.util.Collection<MasterplatePosition> positions, java.lang.String mediumCVName, int plateno, java.util.Date datePoured, PlateCV plateCV)
           
 MasterplateLibraryCV newMasterplateLibraryCV(java.lang.String libraryName, long platecvId)
           
 MasterplateLibraryCV newMasterplateLibraryCV(java.lang.String libraryName, java.lang.String platecvName)
           
 MasterplateSet newMasterplateSet(java.util.Date date, java.lang.String description, java.lang.String librarySt, java.util.Set<java.lang.String> masterplateBarcodes, java.lang.String bgmutationcvSt)
           
 MediumCV newMediumCV(java.lang.String mediumName, java.lang.String description)
          Adds a new mediumCV
 Plate newPlate(java.lang.String barcodeSt, java.lang.String mediumName, java.lang.String plateCVName, java.util.Date datePoured)
           
 PlateCV newPlateCV(java.lang.String name, int numRows, int numColumns)
           
 PlatePosition newPlatePosition(javax.jdo.PersistenceManager pm, Barcode barcode, Position position)
           
 java.util.Collection<Plate> newPlates(java.util.Collection<Plate> plates)
          Presumes that the CVs are detached...
 Position newPosition(javax.jdo.PersistenceManager pm, int row, int column)
           
 ProtocolApplication newProtocolApplication(java.lang.Long protocolRefId, java.lang.String inputPlateCVId, java.lang.String outputPlateCVId)
           
 ProtocolCV newProtocolCV(java.lang.String identifier, java.lang.String name, java.util.Collection<java.lang.String> equipmentIds, boolean isShown)
           
 Repeat newRepeat(java.lang.String description, java.lang.String experimentSt, java.lang.String masterplateSetSt, java.lang.String protocolCVId)
           
 TreatmentCV newTreatmentCV(java.lang.String name, java.lang.String description)
           
 Experiment updateExperiment(java.lang.Long id, java.lang.String name, java.lang.String description, boolean complete)
           
 MediumCV updateMediumCV(java.lang.Long id, java.lang.String mediumName, java.lang.String description)
           
 TreatmentCV updateTreatmentCV(java.lang.Long id, java.lang.String name, java.lang.String description)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Persist

public Persist(DAO dao)
Parameters:
dao -
Method Detail

newBackgroundMutationCV

public BackgroundMutationCV newBackgroundMutationCV(java.lang.String name,
                                                    java.lang.String description)
                                             throws AlreadyExistsException
Persists a new BackgroundMutationCV.

Parameters:
name - unique name
description - short description
Returns:
an object with all of the values in the new BackgroundMutationCV
Throws:
AlreadyExistsException

newMediumCV

public MediumCV newMediumCV(java.lang.String mediumName,
                            java.lang.String description)
                     throws AlreadyExistsException
Adds a new mediumCV

Parameters:
mediumName - the name of the medium
description - the description of the medium
Returns:
the new medium
Throws:
AlreadyExistsException - if a medium by the same name already exists

updateMediumCV

public MediumCV updateMediumCV(java.lang.Long id,
                               java.lang.String mediumName,
                               java.lang.String description)
                        throws QueryNotFoundException
Parameters:
id -
mediumName -
description -
Returns:
Throws:
QueryNotFoundException

newPlateCV

public PlateCV newPlateCV(java.lang.String name,
                          int numRows,
                          int numColumns)
                   throws AlreadyExistsException
Parameters:
name -
numRows -
numColumns -
Returns:
Throws:
AlreadyExistsException

newMasterplateLibraryCV

public MasterplateLibraryCV newMasterplateLibraryCV(java.lang.String libraryName,
                                                    long platecvId)
                                             throws AlreadyExistsException,
                                                    QueryNotFoundException
Parameters:
libraryName -
platecvId -
Returns:
Throws:
AlreadyExistsException
QueryNotFoundException

newMasterplateLibraryCV

public MasterplateLibraryCV newMasterplateLibraryCV(java.lang.String libraryName,
                                                    java.lang.String platecvName)
                                             throws AlreadyExistsException,
                                                    QueryNotFoundException
Parameters:
libraryName -
platecvName -
Returns:
Throws:
AlreadyExistsException
QueryNotFoundException

newPosition

public Position newPosition(javax.jdo.PersistenceManager pm,
                            int row,
                            int column)
Parameters:
pm -
row -
column -
Returns:

newPlatePosition

public PlatePosition newPlatePosition(javax.jdo.PersistenceManager pm,
                                      Barcode barcode,
                                      Position position)
Parameters:
pm -
barcode -
position -
Returns:

newPlates

public java.util.Collection<Plate> newPlates(java.util.Collection<Plate> plates)
Presumes that the CVs are detached...

Parameters:
plates -
Returns:

newPlate

public Plate newPlate(java.lang.String barcodeSt,
                      java.lang.String mediumName,
                      java.lang.String plateCVName,
                      java.util.Date datePoured)
               throws QueryNotFoundException,
                      AlreadyExistsException
Parameters:
barcodeSt -
mediumName -
plateCVName -
datePoured -
Returns:
Throws:
QueryNotFoundException
AlreadyExistsException

newBarcode

public Barcode newBarcode(javax.jdo.PersistenceManager pm,
                          java.lang.String barcodeValue)
Parameters:
pm -
barcodeValue -
Returns:

newMasterplate

public Masterplate newMasterplate(java.lang.String barcodeSt,
                                  java.util.Collection<MasterplatePosition> positions,
                                  java.lang.String mediumCVName,
                                  int plateno,
                                  java.util.Date datePoured,
                                  PlateCV plateCV)
                           throws QueryNotFoundException,
                                  AlreadyExistsException
Parameters:
barcodeSt -
positions -
mediumCVName -
plateno -
datePoured -
plateCV -
Returns:
Throws:
QueryNotFoundException
AlreadyExistsException

newMasterplateSet

public MasterplateSet newMasterplateSet(java.util.Date date,
                                        java.lang.String description,
                                        java.lang.String librarySt,
                                        java.util.Set<java.lang.String> masterplateBarcodes,
                                        java.lang.String bgmutationcvSt)
                                 throws QueryNotFoundException,
                                        AlreadyExistsException
Parameters:
date -
description -
librarySt -
masterplateBarcodes -
bgmutationcvSt -
Returns:
Throws:
QueryNotFoundException
AlreadyExistsException

newExperiment

public Experiment newExperiment(java.lang.String name,
                                java.lang.String description,
                                java.lang.Long protocolCVId,
                                boolean complete,
                                java.lang.Long[] mpsSt)
                         throws QueryNotFoundException,
                                AlreadyExistsException
Parameters:
name -
description -
protocolCVId -
complete -
mpsSt -
Returns:
Throws:
QueryNotFoundException
AlreadyExistsException

updateExperiment

public Experiment updateExperiment(java.lang.Long id,
                                   java.lang.String name,
                                   java.lang.String description,
                                   boolean complete)
                            throws QueryNotFoundException
Parameters:
id -
name -
description -
complete -
Returns:
Throws:
QueryNotFoundException

newRepeat

public Repeat newRepeat(java.lang.String description,
                        java.lang.String experimentSt,
                        java.lang.String masterplateSetSt,
                        java.lang.String protocolCVId)
                 throws QueryNotFoundException
Parameters:
description -
experimentSt -
masterplateSetSt -
protocolCVId -
Returns:
Throws:
QueryNotFoundException

newFeatureCV

public FeatureCV newFeatureCV(java.lang.String featureName,
                              java.lang.String description)
                       throws AlreadyExistsException
Parameters:
featureName -
description -
Returns:
Throws:
AlreadyExistsException

newImage

public Image newImage(java.lang.String uri,
                      ImageCV imageCV,
                      Barcode plate,
                      double threshold,
                      int tileDimX,
                      int tileDimY)
Parameters:
uri -
imageCV -
plate -
threshold -
tileDimX -
tileDimY -
Returns:

newImageCV

public ImageCV newImageCV(java.lang.String description)
                   throws AlreadyExistsException
Parameters:
description -
Returns:
Throws:
AlreadyExistsException

newImageResult

public ImageResult newImageResult(int area,
                                  int trimmedArea,
                                  int intensity,
                                  int edgePixels,
                                  ImageSpot imageSpot,
                                  FeatureCV featureCV,
                                  Image referencedImage,
                                  int xOffset,
                                  int yOffset,
                                  java.awt.Color colonyColor,
                                  java.awt.Color backgroundColor,
                                  int edgeLength)
Parameters:
area -
trimmedArea -
intensity -
edgePixels -
imageSpot -
featureCV -
referencedImage -
xOffset -
yOffset -
colonyColor -
backgroundColor -
edgeLength -
Returns:

newImageTransformation

public ImageTransformation newImageTransformation(java.lang.String parameters,
                                                  Image inputImage,
                                                  Image outputImage,
                                                  ImageTransformationCV imageTransformationCV)
Parameters:
parameters -
inputImage -
outputImage -
imageTransformationCV -
Returns:

newImageTransformationCV

public ImageTransformationCV newImageTransformationCV(java.lang.String name)
                                               throws AlreadyExistsException
Parameters:
name -
Returns:
Throws:
AlreadyExistsException

addPlateTreatments

public java.util.Collection<PlateTreatment> addPlateTreatments(java.lang.String barcode,
                                                               java.util.ArrayList<java.util.Date> dates,
                                                               java.util.ArrayList<java.lang.String> treatmentNames)
                                                        throws QueryNotFoundException
Parameters:
barcode -
dates -
treatmentNames -
Returns:
Throws:
QueryNotFoundException

addPlateTreatments

public java.util.Map<java.lang.String,java.lang.Exception> addPlateTreatments(java.util.List<java.lang.String> barcodes,
                                                                              java.util.Date date,
                                                                              java.lang.Long treatmentCvId)
                                                                       throws QueryNotFoundException
Parameters:
barcodes -
date -
treatmentCvId -
Returns:
Throws:
QueryNotFoundException

newTreatmentCV

public TreatmentCV newTreatmentCV(java.lang.String name,
                                  java.lang.String description)
                           throws AlreadyExistsException
Parameters:
name -
description -
Returns:
Throws:
AlreadyExistsException

updateTreatmentCV

public TreatmentCV updateTreatmentCV(java.lang.Long id,
                                     java.lang.String name,
                                     java.lang.String description)
                              throws QueryNotFoundException
Parameters:
id -
name -
description -
Returns:
Throws:
QueryNotFoundException

newEquipmentCV

public EquipmentCV newEquipmentCV(java.lang.String identifier,
                                  java.lang.String make,
                                  java.lang.String model,
                                  java.lang.String name,
                                  java.lang.String serialNumber)
                           throws AlreadyExistsException
Parameters:
identifier -
make -
model -
name -
serialNumber -
Returns:
Throws:
AlreadyExistsException

newProtocolCV

public ProtocolCV newProtocolCV(java.lang.String identifier,
                                java.lang.String name,
                                java.util.Collection<java.lang.String> equipmentIds,
                                boolean isShown)
                         throws AlreadyExistsException,
                                QueryNotFoundException
Parameters:
identifier -
name -
equipmentIds -
isShown -
Returns:
Throws:
AlreadyExistsException
QueryNotFoundException

newActionCV

public ActionCV newActionCV(java.lang.String protocolID,
                            java.lang.String identifier,
                            int actionOrdinal,
                            java.lang.String actionText,
                            java.lang.String name,
                            java.lang.String subProtocolID,
                            boolean repeatable)
                     throws AlreadyExistsException,
                            QueryNotFoundException
Parameters:
protocolID -
identifier -
actionOrdinal -
actionText -
name -
subProtocolID -
repeatable -
Returns:
Throws:
AlreadyExistsException
QueryNotFoundException

newProtocolApplication

public ProtocolApplication newProtocolApplication(java.lang.Long protocolRefId,
                                                  java.lang.String inputPlateCVId,
                                                  java.lang.String outputPlateCVId)
                                           throws QueryNotFoundException
Parameters:
protocolRefId -
inputPlateCVId -
outputPlateCVId -
Returns:
Throws:
QueryNotFoundException

newActionApplication

public ActionApplication newActionApplication(java.lang.String actionRefId,
                                              java.lang.Long protocolAppId)
                                       throws QueryNotFoundException
Parameters:
actionRefId -
protocolAppId -
Returns:
Throws:
QueryNotFoundException

newActionApplication

public ActionApplication newActionApplication(javax.jdo.PersistenceManager pm,
                                              ActionCV actionCV,
                                              ProtocolApplication protocolApp,
                                              PlateCV input,
                                              PlateCV output)
Parameters:
pm -
actionCV -
protocolApp -
input -
output -
Returns:


Copyright © 2010. All Rights Reserved.