我是新来ormlite,我想设置默认值对于某些领域,如如何将默认值设置为ormlite中的列?
@DatabaseField(generatedId = true, canBeNull = false)
int id;
@DatabaseField(canBeNull = true)
String user_type;
@DatabaseField(canBeNull = true)
String username;
@DatabaseField(canBeNull = true)
String password;
@DatabaseField(canBeNull = true)
int id_color;
我不得不设置的用户名字段的默认值。我该怎么做呢?提前致谢!!!!
我应该如何处理'defaultValue'为'boolean'?我知道这是在'SQLite'中存储为'int',但是'defaultValue =“1”'和'defaultValue =“true”'似乎都不起作用。我可以在创建之前使用'setter'来设置它,但我希望避免这种情况。 – theblang 2015-02-09 21:33:13
@mattblang尝试将布尔值更改为布尔值 – anagaf 2015-07-25 15:06:47