Skip to content
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

Consider creating a UUID type and other variants of core.Id #7

Open
stewSquared opened this issue Dec 7, 2016 · 0 comments
Open

Consider creating a UUID type and other variants of core.Id #7

stewSquared opened this issue Dec 7, 2016 · 0 comments
Labels

Comments

@stewSquared
Copy link
Contributor

stewSquared commented Dec 7, 2016

Let's say PatientsRow.patientId is the primary key of table Patients. It has type Id[PatientsRow].

If the type that comes from the database is a serial identifier, it will be mapped to a Long, then subsequently converted to a String for Id construction. If it's a uuid, it will first be mapped to a java.util.UUID instead.

The question is, should we track the underlying type of an Id? Are two Id's the same type as long as they're of the same entitity? Even if one was made from a Long while the other was made from a UUID? Do we ever really care about the underlying implementation?

We can only convert an Id into a Long for insertion to the database if we know Long was the underlying type. Slick table definitions will remember the underlying type, so this shouldn't be a problem unless we're constructing Id values (which we shouldn't do.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants