def mapPinnedTroves(self, mapList):
        if not mapList:
            return

        cu = self.db.cursor()
        cu.execute("""
        CREATE TEMPORARY TABLE mlt(
            name             %(STRING)s,
            pinnedVersion    %(STRING)s,
            pinnedFlavor     %(STRING)s,
            mappedVersion    %(STRING)s,
            mappedTimestamps %(STRING)s,
            mappedFlavor     %(STRING)s
        ) """ % self.db.keywords)

        def _iter(ml):
            for (name, pinnedInfo, mapInfo) in ml:
                assert(sum(mapInfo[0].timeStamps()) > 0)
                if pinnedInfo[1] is None or pinnedInfo[1].isEmpty():
                    pinnedFlavor = None
                else:
                    pinnedFlavor = pinnedInfo[1].freeze()

                if mapInfo[1] is None or mapInfo[1].isEmpty():
                    mapFlavor = None
                else:
                    mapFlavor = mapInfo[1].freeze()
                yield (name, pinnedInfo[0].asString(), pinnedFlavor,
                       mapInfo[0].asString(),
                       ":".join([ "%.3f" % x for x in mapInfo[0].timeStamps()]),
                       mapFlavor)

            cu.executemany("INSERT INTO mlt VALUES(?, ?, ?, ?, ?, ?)",
                           _iter(mapList))

        # now add link collections to these troves
        cu.execute("""INSERT INTO TroveTroves (instanceId, includedId,
                                               flags, inPristine)
                        SELECT TroveTroves.instanceId, pinnedInst.instanceId,
                               TroveTroves.flags, 0 FROM
                            mlt JOIN Flavors AS pinFlv ON
                                pinnedFlavor == pinFlv.flavor OR
                                pinnedFlavor IS NULL and pinFlv.flavor IS NULL
                            JOIN Versions AS pinVers ON
                                pinnedVersion == pinVers.version
                            JOIN Instances as pinnedInst ON
                                pinnedInst.troveName == mlt.name AND
                                pinnedInst.flavorId == pinFlv.flavorId AND
                                pinnedInst.versionId == pinVers.versionId
                            JOIN Flavors AS mapFlv ON
                                mappedFlavor == mapFlv.flavor OR
                                mappedFlavor IS NULL and mapFlv.flavor IS NULL
                            JOIN Versions AS mapVers ON
                                mappedVersion == mapVers.version
                            JOIN Instances as mapInst ON
                                mapInst.troveName == mlt.name AND
                                mapInst.flavorId == mapFlv.flavorId AND
                                mapInst.versionId == mapVers.versionId
                            JOIN TroveTroves ON
                                TroveTroves.includedId == mapInst.instanceId
                            LEFT JOIN TroveTroves AS dup ON
                                (dup.instanceId == TroveTroves.instanceId AND
                                 dup.includedId == pinnedInst.instanceId)
                            WHERE dup.instanceId IS NULL
                    """)

        cu.execute("DROP TABLE mlt")