Package org.intermine.api.bag
Class PkQueryIdUpgrader
- java.lang.Object
-
- org.intermine.api.bag.PkQueryIdUpgrader
-
- All Implemented Interfaces:
IdUpgrader
public class PkQueryIdUpgrader extends java.lang.Object implements IdUpgrader
Bag object id upgrader that uses the primary keys to find the objects in the new ObjectStore.- Author:
- Kim Rutherford
-
-
Field Summary
-
Fields inherited from interface org.intermine.api.bag.IdUpgrader
ERROR_UPGRADER
-
-
Constructor Summary
Constructors Constructor Description PkQueryIdUpgrader(java.lang.String sourceName, ObjectStore os)
Construct with the name of a source - will use defined keys to upgrade bags.PkQueryIdUpgrader(ObjectStore os)
No argument constructor - will use all available keyDefs to upgrade bags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doUpgrade()
Return true if upgrade should be performed.java.util.Set<java.lang.Integer>
getNewIds(InterMineObject oldObject, ObjectStore os)
For the given object from an old ObjectStore, find the corresponding InterMineObjects in a new ObjectStore.
-
-
-
Constructor Detail
-
PkQueryIdUpgrader
public PkQueryIdUpgrader(ObjectStore os)
No argument constructor - will use all available keyDefs to upgrade bags.- Parameters:
os
- the ObjectStore to query
-
PkQueryIdUpgrader
public PkQueryIdUpgrader(java.lang.String sourceName, ObjectStore os)
Construct with the name of a source - will use defined keys to upgrade bags.- Parameters:
sourceName
- name of sourceos
- the ObjectStore to query
-
-
Method Detail
-
doUpgrade
public boolean doUpgrade()
Return true if upgrade should be performed.- Specified by:
doUpgrade
in interfaceIdUpgrader
- Returns:
- true if upgrade should be performed
-
getNewIds
public java.util.Set<java.lang.Integer> getNewIds(InterMineObject oldObject, ObjectStore os)
For the given object from an old ObjectStore, find the corresponding InterMineObjects in a new ObjectStore. Primary keys are used to find the objects.- Specified by:
getNewIds
in interfaceIdUpgrader
- Parameters:
oldObject
- the template objectos
- ObjectStore used to resolve objects- Returns:
- the set of new InterMineObjects
-
-