I could not find any information on how to annotate the value SQL - DEFAULT, scanning documents @ColumnInfo for new Android Persistence Library.
Does Room provide annotation for default values?
My current solution would be to manually create the appropriate table ...
CREATE TABLE MyTable (
...
MyDefaultValuedCol TEXT DEFAULT 'Default Value',
MyDefaultFlagCol INT DEFAULT 1
)
... and put the room on top.
@Entity(tableName = "MyTable")
class MyClass {
...
public String MyDefaultValuedCol;
public boolean MyDefaultFlagCol;
}
source
share