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
@id attribute of case class without Option #269
Comments
This is enforced in Marshallable, and since that's used by both You could do the following though:
|
Initially I expected that wartremover will complain about the usage of |
I don't follow - I'm hesitant of duplicating Marshallable. If the above really doesn't work for you, maybe it's best to get the old behaviour back and remove that assertion in the macro. Still, please do consider the |
Sorry, my bad, I meant that the |
The internet disagrees:
https://dzone.com/articles/cost-laziness Anyway, we can lift that assertion if you like (basically back to how it was). Mind sending me a PR? |
Sure, will submit the PR for this. |
We are using gremlin-scala v-3.3.3.4. We use JanusGraph and have the following data model w.r.t case classes. For each vertex, we have two case classes one for writing to the database and one for reading from the database. The only difference is that the case class which is used for writing to the database has the id as
Option[id]
whereas in the case class which used for reading from database the Id is not anOption
.For example, we have the user vertex as follows:
The reason why we have a different case class during the read is because we are sure that the Id is going to be there when we read from the Database and we can avoid matching on the
Option[id]
to get the Id. Upgrading to the latest version of gremlin-scala is giving the following errors for the all case classes which doesn't have Id asOption
.We understand the error message
we have to let the graph assign an id
which is only when adding the vertex to the database, but why is this enforced ontoCC[UserVertex]
?The text was updated successfully, but these errors were encountered: