1
我想我的類映射到使用ORMLite SQLite數據庫和我有麻煩來存儲字符串的集合,我有此錯誤:如何原始型(String)的集合存儲到數據庫
java.lang.IllegalArgumentException: No fields have a DatabaseField annotation in
class java.lang.String
這個錯誤是不言自明的,但我如何存儲字符串集合,我應該擴展字符串類並添加所需的註釋才能做到這一點? 在字段的註釋中我添加了datatype.serializable,但這也行不通。 這裏是我的課堂,我的問題:
@DatabaseTable(tableName = "parameters")
public class Parameters {
// id is generated by the database and set on the object automagically
@DatabaseField(generatedId = true)
int id_parameters;
@DatabaseField(canBeNull = true)
@JsonProperty("id")
private Integer id;
@DatabaseField(canBeNull = false)
@JsonProperty("account_id")
private Integer account_id;
@ForeignCollectionField
@JsonProperty("languages")
private Collection<String> languages;
...
}
領域的問題是語言!
感謝您清除此問題! – 2013-04-24 21:28:12