org.intermine.dataloader
Interface EquivalentObjectFetcher

All Known Implementing Classes:
BaseEquivalentObjectFetcher, BatchingFetcher, HintingFetcher, ParallelBatchingFetcher

public interface EquivalentObjectFetcher

Interface providing methods to look up equivalent objects by primary key in a production objectstore.


Method Summary
 java.util.Set<Query> createPKQueriesForClass(InterMineObject obj, Source source, boolean queryNulls, ClassDescriptor cld)
          Generates a query that searches for all objects in the database equivalent to a given example object, considering only one of it's classes.
 Query createPKQuery(InterMineObject obj, Source source, boolean queryNulls)
          Generates a query that searches for all objects in the database equivalent to a given example object according to the primary keys defined for the given source.
 java.util.Set<InterMineObject> queryEquivalentObjects(InterMineObject obj, Source source)
          Returns a Set of objects that are equivalent to the given object, according to the primary keys defined by the given Source.
 

Method Detail

queryEquivalentObjects

java.util.Set<InterMineObject> queryEquivalentObjects(InterMineObject obj,
                                                      Source source)
                                                      throws ObjectStoreException
Returns a Set of objects that are equivalent to the given object, according to the primary keys defined by the given Source.

Parameters:
obj - the Object to look for
source - the data Source
Returns:
a Set of InterMineObjects
Throws:
ObjectStoreException - if an error occurs

createPKQuery

Query createPKQuery(InterMineObject obj,
                    Source source,
                    boolean queryNulls)
                    throws MetaDataException
Generates a query that searches for all objects in the database equivalent to a given example object according to the primary keys defined for the given source.

Parameters:
obj - the Object to take as an example
source - the Source database
queryNulls - if true allow primary keys to contain null values if the template obj has nulls. If false the Query will constrain only those keys that have a value in the template obj
Returns:
a new Query (or null if all the primary keys from obj contain a null)
Throws:
MetaDataException - if anything goes wrong

createPKQueriesForClass

java.util.Set<Query> createPKQueriesForClass(InterMineObject obj,
                                             Source source,
                                             boolean queryNulls,
                                             ClassDescriptor cld)
                                             throws MetaDataException
Generates a query that searches for all objects in the database equivalent to a given example object, considering only one of it's classes.

Parameters:
obj - the Object to take as an example
source - the Source database
queryNulls - if true allow primary keys to contain null values if the template obj has nulls. If false the Query will constrain only those keys that have a value in the template obj
cld - one of the classes that obj is. Only primary keys for this classes will be considered
Returns:
a new Query (or null if all the primary keys from obj contain a null)
Throws:
MetaDataException - if anything goes wrong