我有类Item,它从带有注释ORMLite的模型扩展
@DatabaseTable
public class Item extends Model {
@DatabaseField(id = true)
public String id;
@DatabaseField
public String title;
@DatabaseField
public String details;
@DatabaseField
public String phone;
@DatabaseField(defaultValue = "1000")
public int position;
}
ItemRepository repository = App.getRestAdapter().createRepository(ItemRepository.class);
repository.findAll(new ListCallback<Item>() {
@Override
public void onSuccess(List<Item> objects) {
//here is my breakpoint
}
}
存储库
public class ItemRepository extends ModelRepository<Item> {
public ItemRepository() {
super("item", Item.class);
}
}
/common/models/item.json是:
{
"name": "item",
"base": "PersistedModel",
"strict": false,
"idInjection": false,
"options": {
"validateUpsert": true
},
"properties": {
"details": {
"type": "string"
},
"title": {
"type": "string"
},
"phone": {
"type": "string",
"id": false
},
"id": {
"type": "number",
"id": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
答案 0 :(得分:0)
最后我找到了答案。当我添加setter和getter时,它有效!