dwhjames / datomisca

Datomisca: a Scala API for Datomic
https://dwhjames.github.io/datomisca/
Apache License 2.0
130 stars 28 forks source link

Refactor implementation of temporary ids #102

Closed dwhjames closed 10 years ago

dwhjames commented 10 years ago

This resolves an issue with the previous implementation of TempId not having overrides for equals and hashCode, so equality was by reference and thus effectively broken.

TempId is now a value class wrapping a datomic.db.DbId. This object is nothing more than a map from :part to the partition ident keyword and from :idx to a long. The new implementation of TempId exposes the partition and the index. equals and hashCode now come directly from the datomic.db.DbId object and toString delegates to it.