-
Notifications
You must be signed in to change notification settings - Fork 133
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
use direct associations with Orma v2 #312
Conversation
👀 |
|
||
@Table | ||
public class Contributor { | ||
|
||
@PrimaryKey | ||
@PrimaryKey(auto = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question of Orma.
What is this option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In default settings, Orma's @PrimaryKey
is automatically assigned by SQLite, even if autoincrement = true
is not specified.
In this case, each ID comes from the API so it is not an "auto" value.
You can see the difference in Contributor_Schema.java
by comparing both cases: @PrimaryKey(auto = true)
(default) and @PrimaryKey(auto = false)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized it. Thanks!
LGTM!! |
use direct associations with Orma v2
Use Orma v2.0 to use direct associations where an Orma model has other Orma models as a reference.
Unfortunately this change seems conflict with #132, which fails with this PR. In this case, however, Mockito makes no sense because Orma works with Robolectric and you can test input and output of Orma/SessionDao without Mockito.