-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too many unsafe UUID.fromString(id.value)
statements.
#82
Comments
I don't quite understand this issue? Is it related to slick? |
Yep. We might have a model with a typed Id that maps to a uuid field in slick. When we do something like: Cancers.filter(_.patientId === UUID.fromString(id.value)) There's no guarantee that If you instead write: Cancers.filter(_.patientId == UUIDfromId[Patient](id)) the code is more semantic, and the |
@jodersky Stewart wants |
@vuspenskiy haha, thanks for noticing, though that's less of an issue in this codebase 😛 |
In the short term, some repos (reimbursements, patients) have a method that help with this:
Though said method should be used with an explicit type.
Perhaps an even better solution could arise from creating an easy way to instantiate a
MappedColumnType
for specific Id types.Edit: didn't mean to name method
fromString
The text was updated successfully, but these errors were encountered: