Class 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
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 source
        os - the ObjectStore to query
    • Method Detail

      • doUpgrade

        public boolean doUpgrade()
        Return true if upgrade should be performed.
        Specified by:
        doUpgrade in interface IdUpgrader
        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 interface IdUpgrader
        Parameters:
        oldObject - the template object
        os - ObjectStore used to resolve objects
        Returns:
        the set of new InterMineObjects