Package org.intermine.dataloader
Interface IntegrationWriter
-
- All Superinterfaces:
ObjectStore
,ObjectStoreWriter
- All Known Implementing Classes:
IntegrationWriterAbstractImpl
,IntegrationWriterDataTrackingImpl
public interface IntegrationWriter extends ObjectStoreWriter
Define methods needed to deal with integration when writing to an ObjectStore. To retain O/R mapping independence implementations of this interface should delegate writing to a mapping tool specific implementation of ObjectStoreWriter.- Author:
- Richard Smith, Matthew Wakeling
-
-
Field Summary
-
Fields inherited from interface org.intermine.objectstore.ObjectStore
SEQUENCE_IGNORE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Source
getMainSource(java.lang.String name, java.lang.String type)
Converts a string describing the data source into a Source object suitable for passing to the store method as the main source.Source
getSkeletonSource(java.lang.String name, java.lang.String type)
Converts a string describing the data source into a Source object suitable for passing to the store method as the skeleton source.void
setIgnoreDuplicates(boolean ignoreDuplicates)
Tell this IntegrationWriter whether to ignore duplicate objects from the same source.void
store(FastPathObject o, Source source, Source skelSource)
Stores the given object in the objectstore.-
Methods inherited from interface org.intermine.objectstore.ObjectStore
cacheObjectById, count, createClob, createObjectStoreBag, estimate, execute, execute, execute, executeSingleton, executeSingleton, flushObjectById, getComponentsForQuery, getMaxLimit, getMaxOffset, getMaxTime, getModel, getNewWriter, getObjectByExample, getObjectById, getObjectById, getObjectsByExample, getObjectsByIds, getSequence, getSerial, invalidateObjectById, isMultiConnection, pilferObjectById, prefetchObjectById
-
Methods inherited from interface org.intermine.objectstore.ObjectStoreWriter
abortTransaction, addAllToBag, addToBag, addToBagFromQuery, addToCollection, batchCommitTransaction, beginTransaction, close, commitTransaction, delete, delete, getObjectStore, isInTransaction, removeAllFromBag, removeFromBag, replaceClob, store
-
-
-
-
Method Detail
-
store
void store(FastPathObject o, Source source, Source skelSource) throws ObjectStoreException
Stores the given object in the objectstore. To update an objectstore with data in the form of an interconnected graph of objects, call this method on each of the objects in that structure. This method will take care of merging objects, and resolving field priority issues.- Parameters:
o
- the object to storesource
- the data Source to which to attribute the dataskelSource
- the data Source to which to attribute skeleton data- Throws:
ObjectStoreException
- if an error occurs in the underlying objectstore
-
getMainSource
Source getMainSource(java.lang.String name, java.lang.String type) throws ObjectStoreException
Converts a string describing the data source into a Source object suitable for passing to the store method as the main source.- Parameters:
name
- the name of the data sourcetype
- the source type- Returns:
- a Source
- Throws:
ObjectStoreException
- if something goes wrong
-
getSkeletonSource
Source getSkeletonSource(java.lang.String name, java.lang.String type) throws ObjectStoreException
Converts a string describing the data source into a Source object suitable for passing to the store method as the skeleton source.- Parameters:
name
- the name of the data sourcetype
- the source type- Returns:
- a skeleton Source
- Throws:
ObjectStoreException
- if something goes wrong
-
setIgnoreDuplicates
void setIgnoreDuplicates(boolean ignoreDuplicates)
Tell this IntegrationWriter whether to ignore duplicate objects from the same source. ALL DUPLICATES OF THE OBJECT MUST HAVE THE SAME FIELDS FILLED IN WITH THE SAME DATA. Data that differs between copies will result in undefined behaviour as so what data will appear in the destination database. Data that differs in primary keys may result in an exception being thrown during data loading. Note that setting a field to null differs from another copy with the field set to a value.- Parameters:
ignoreDuplicates
- the value of ignoreDuplicates
-
-