Skip to content

Commit

Permalink
Cast ids to misk.hibernate.Id instead of Long in BulkShardMigrator
Browse files Browse the repository at this point in the history
  • Loading branch information
surrahman committed Aug 7, 2019
1 parent 4ee2b86 commit 89b1861
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -206,10 +206,9 @@ class BulkShardMigrator<R : DbRoot<R>, C : DbChild<R, C>> private constructor(
"SELECT id FROM $tableName WHERE $rootColumnName = :target AND id IN (:ids)"
).setParameter("target", targetRoot!!.id)
.setParameterList("ids", sourceRecords.keys)
.list()
.stream()
.map { it as Long }
.collect(Collectors.toSet<Long>())
.resultList
.map { (it as Id<*>).id }
.toSet()

logger.info(
"Bulk migrating (distinct shard) ${sourceRecords.size} entities for table $tableName"
Expand Down

0 comments on commit 89b1861

Please sign in to comment.