on save() foreign key can't be null
Hi! Im trying to save jsonmodel and passing some foreign keys that has null values as a relation is not defined yet. I got NullPointerException in bindToStatement in $Container. How do i allow it to save null values in foreign keys? (i tried these: notNull = false, saveForeignKeyModel = false, still no results)
Thanks
Hey can you send me what your model looks like? thank you.
http://pastebin.com/KZ6rbw8A where AQL and Supplier foreign keys can have null values
It's a bug. I will add a check to ensure that the getValue is not null for the ModelContainer as foreign key. Also adding unit test here.
Nice find!
Meanwhile is there any quick fix? Thanks in advance.
@OptimistNot not for such an error. Can you send me the $Container generated class as well and line number its failing on? thanks
http://pastebin.com/sLV4UxLw on lines 145-148
Also can you ensure all inner classes have @ContainerAdapter annotatons?
NVM. It may be a conversion from a null Long to a long
Maybe, but there is nothing i can do about it. If i have null value there is no long foreign key to look for. I tried today to fork dbflow and include in my project to change columndefinition class to add if null condition for container but i really stuck with it... I cant get Android studio to include the module, and i need a fast solution.
@OptimistNot its going to be fully fixed in 2.0.0 now. I had to rewrite the underlying code generator and consequently does some breaking changes (but for consitency and the better) so 2.0.0 should be released soon instead of 1.9.0
hopefully EOD tomorrow or Monday
Thank you for your quick response! Sorry hurry u up... Waiting for 2.0.0 to be released as soon as possible :) Thanks!