You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, first, thank you for this nice and simple ORM library!
I noticed a problem in my project with a many-to-one relationship.
I basically have these classes:
class Person extends SugarRecord {
private Group group;
...
}
class Group extends SugarRecord {
}
When I call new Person().save();, I get this error:
FATAL EXCEPTION: main
Process: mypackage, PID: 9915
android.database.sqlite.SQLiteException: near "GROUP": syntax error (code 1): , while compiling: INSERT OR REPLACE INTO PERSON(GROUP,GENDER,ID,AGE_GROUP) VALUES (?,?,?,?)
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
at com.orm.SugarRecord.save(SugarRecord.java:280)
at com.orm.SugarRecord.save(SugarRecord.java:416)
...
Hi, first, thank you for this nice and simple ORM library!
I noticed a problem in my project with a many-to-one relationship.
I basically have these classes:
When I call
new Person().save();
, I get this error:Note that this is a special case:
group == null
According to the homepage, it should work: http://satyan.github.io/sugar/creation.html#why - am I wrong?
Notes:
Long groupId
toGroup group
.deleteDatabase(name)
.The text was updated successfully, but these errors were encountered: