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
SQL Error when updating objects #7
Comments
Can you confirm you have this set to true in your manifest?
Also as a side note, you do not need to save the children first, saving the parent object takes care of that for you. |
Thanks for the hint.
|
Ok, can I also confirm you are using v0.8.0? Obstructing the underlying SQL error was a mistake which ill be updating soon. |
Yes, I used v0.8.0 with this example. Yesterday I was using v0.7.0 and got a more expressive log output, stating an invalid sql update statement of the form
The UPDATE keyword was missing for the second object. |
If you add just a random extra field to the parent does that fix it? |
I added an extra String field to the parent, but unfortunately it still crashes with the same exception |
Are you classes inner classes? |
No, these are normal classes |
I have reproduced your crash, I think I already have a fix on another branch which is basically ready to integrate so should be fixed very soon. Thanks for you patience. |
Should be fixed now with version 1.0.0, will require a clean install though. Let me know if it works. Thanks |
Thanks a lot for your quick fix. It works now! |
First, thanks for your great work. I'm planning to use your framework for my next app.
I'm having the following issue: When I create objects with parent-child relationship, store them, load them again, change something and store them again the framework crashes with a SQL Error. See the following minimal working example:
Stacktrace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.test.testrushorm/de.test.testrushorm.MainActivity}: co.uk.rushorm.core.exceptions.RushSqlException: This is most likely caused by a change in data structure or new RushObject.
This issue should be resolved by a database migration.
This can be done by updating db version number in the manifest or setting Rush in debug mode.
To set Rush in debug mode add this to your manifest file -
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2103)
at android.app.ActivityThread.access$600(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4827)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
Caused by: co.uk.rushorm.core.exceptions.RushSqlException: This is most likely caused by a change in data structure or new RushObject.
This issue should be resolved by a database migration.
This can be done by updating db version number in the manifest or setting Rush in debug mode.
To set Rush in debug mode add this to your manifest file -
at co.uk.rushorm.android.AndroidRushStatementRunner.runRaw(AndroidRushStatementRunner.java:35)
at co.uk.rushorm.core.RushCore$6.createdOrUpdateStatement(RushCore.java:238)
at co.uk.rushorm.core.implementation.ReflectionStatementGenerator$3.doAction(ReflectionStatementGenerator.java:366)
at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.doLoop(ReflectionStatementGenerator.java:73)
at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.updateObjects(ReflectionStatementGenerator.java:342)
at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.generateSaveOrUpdate(ReflectionStatementGenerator.java:169)
at co.uk.rushorm.core.RushCore.save(RushCore.java:224)
at co.uk.rushorm.core.RushCore.save(RushCore.java:95)
at co.uk.rushorm.core.RushCore.save(RushCore.java:90)
at co.uk.rushorm.core.RushObject.save(RushObject.java:10)
at de.test.testrushorm.MainActivity.onCreate(MainActivity.java:30)
at android.app.Activity.performCreate(Activity.java:5013)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2042)
... 11 more
The error seems to be related to the creation of the sql update statements. Any ideas? Did I do something wrong?
The text was updated successfully, but these errors were encountered: