uk.ac.cisban.rod.dao
Class Exists

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

public class Exists
extends java.lang.Object

For checking if database objects exist in the database. Calls count() on the rows rather than returning them, so hopefully less memory-intensive.

Since:
17-Dec-2009, 11:23:24
Author:
Morgan Taschuk

Constructor Summary
Exists(DAO dao)
          Initial constructor
 
Method Summary
 java.lang.Long findMasterplatePositions(javax.jdo.PersistenceManager pm, java.lang.Long masterplateId)
          Finds number of MasterplatePositions on a masterplate.
 java.lang.Long findPlatePositions(javax.jdo.PersistenceManager pm, java.lang.Long barcodeId)
          Finds number of Spottings for a barcode DB id.
 boolean imageSpot(javax.jdo.PersistenceManager pm, java.lang.Long sourceBarcode)
          Checks whether an ImageSpot exists with the given source Barcode and destination Barcode.
 boolean inoculation(javax.jdo.PersistenceManager pm, java.lang.Long sourceBarcode, java.lang.Long destinationBarcode)
          Checks whether an Inoculation exists with the given source Barcode and destination Barcode.
 long logs(long aAppId)
          Get the number of logs for the ActionApplication.
 java.util.Collection<java.lang.String> plates(java.util.Collection<java.lang.String> barcodes)
          If all plates exist, an empty collection will be returned.
 long spots(long imageId)
          Finds number of ImageSpots on an Image.
 boolean spotting(javax.jdo.PersistenceManager pm, java.lang.Long sourceBarcode, java.lang.Long destinationBarcode)
          Checks whether an Spotting exists with the given source Barcode and destination Barcode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exists

public Exists(DAO dao)
Initial constructor

Parameters:
dao -
Method Detail

inoculation

public boolean inoculation(javax.jdo.PersistenceManager pm,
                           java.lang.Long sourceBarcode,
                           java.lang.Long destinationBarcode)
Checks whether an Inoculation exists with the given source Barcode and destination Barcode.

Parameters:
pm - the persistence manager
sourceBarcode - the PK of the source barcode
destinationBarcode - the PK of the destination barcode
Returns:
true if the inoculation exists in the database, false otherwise

spotting

public boolean spotting(javax.jdo.PersistenceManager pm,
                        java.lang.Long sourceBarcode,
                        java.lang.Long destinationBarcode)
Checks whether an Spotting exists with the given source Barcode and destination Barcode.

Parameters:
pm - the persistence manager
sourceBarcode - the PK of the source barcode
destinationBarcode - the PK of the destination barcode
Returns:
true if the Spotting exists in the database, false otherwise

imageSpot

public boolean imageSpot(javax.jdo.PersistenceManager pm,
                         java.lang.Long sourceBarcode)
Checks whether an ImageSpot exists with the given source Barcode and destination Barcode.

Parameters:
pm - the persistence manager
sourceBarcode - the PK of the source barcode
Returns:
true if the ImageSpot exists in the database, false otherwise

plates

public java.util.Collection<java.lang.String> plates(java.util.Collection<java.lang.String> barcodes)
If all plates exist, an empty collection will be returned. If any are not found, those barcodes will be in the returned colleciton

Parameters:
barcodes - to find
Returns:
collection of unexisting barcodes

logs

public long logs(long aAppId)
Get the number of logs for the ActionApplication.

Parameters:
aAppId - DB id
Returns:
number of logs

findPlatePositions

public java.lang.Long findPlatePositions(javax.jdo.PersistenceManager pm,
                                         java.lang.Long barcodeId)
                                  throws QueryNotFoundException
Finds number of Spottings for a barcode DB id.

Parameters:
pm - the persistence manager
barcodeId -
Returns:
number of Spottings
Throws:
QueryNotFoundException

findMasterplatePositions

public java.lang.Long findMasterplatePositions(javax.jdo.PersistenceManager pm,
                                               java.lang.Long masterplateId)
                                        throws QueryNotFoundException
Finds number of MasterplatePositions on a masterplate.

Parameters:
pm -
masterplateId -
Returns:
number of MasterplatePositions
Throws:
QueryNotFoundException

spots

public long spots(long imageId)
Finds number of ImageSpots on an Image.

Parameters:
imageId -
Returns:
number of ImageSpots.


Copyright © 2010. All Rights Reserved.