maskarade/Android-Orma

table with automatic ID?

Closed this issue · 1 comments

Hi,
I have a table with

    @PrimaryKey (autoincrement = true)
    Long id;
    @Column...with the rest of the columns

but when I try to insert elements, without setting the 'id' value to anything, I get the error:
java.lang.IllegalArgumentException: HistoryItem.id must not be null, or use @nullable to declare it as NULL

Could you please let me know how to use automatic IDs in the tables?
Thanks!

gfx commented

Sorry to poor document but it is intended behavior. Use long instead of Long if you use auto id. Primary keys require a primitive type.