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

use direct associations with Orma v2 #312

Merged
merged 4 commits into from
Feb 22, 2016
Merged

use direct associations with Orma v2 #312

merged 4 commits into from
Feb 22, 2016

Conversation

gfx
Copy link
Contributor

@gfx gfx commented Feb 22, 2016

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.

@konifar
Copy link
Owner

konifar commented Feb 22, 2016

👀


@Table
public class Contributor {

@PrimaryKey
@PrimaryKey(auto = false)
Copy link
Owner

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?

Copy link
Contributor Author

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).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized it. Thanks!

@konifar
Copy link
Owner

konifar commented Feb 22, 2016

LGTM!!

konifar added a commit that referenced this pull request Feb 22, 2016
use direct associations with Orma v2
@konifar konifar merged commit d811864 into konifar:master Feb 22, 2016
@gfx gfx deleted the use_orma2 branch February 22, 2016 14:48
@konifar konifar added this to the 1.1.4 milestone Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants