-
Notifications
You must be signed in to change notification settings - Fork 583
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
Save() behaves different with annotated and extended entities #243
Labels
Comments
jivimberg
added a commit
to jivimberg/sugar
that referenced
this issue
Jan 31, 2015
jivimberg
added a commit
to jivimberg/sugar
that referenced
this issue
Feb 1, 2015
Conflicts: library/build.gradle sugartestapp/src/androidTest/java/me/jivimberg/android/sugartestapp/robolectric/SugarRecordTest.java sugartestapp/src/main/java/me/jivimberg/android/sugartestapp/model/annotated/Car.java
whoshuu
added a commit
that referenced
this issue
Apr 7, 2015
Closes #254 References #185 References #215 References #243 Thanks @jivimberg for the pull request!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've noticed that the following code will behave differently depending if the entity extends
SugarRecord
or if it's annotated with@Table
In the first case (extending) the second save() will replace the value of the row saved in the first save(), while in the annotated case it will save 2 different objects in the DB.
I understand why this is the case. When extending SugarRecord has an
id
field where it saves a reference of the row ID so in the second save it can tell that it's the same object. This is not true when using annotations.This is a problem when trying to update an entity that's annotated. See #185
The text was updated successfully, but these errors were encountered: