我在OrmLite
有一個數據庫。表的 這裏一個 - Field
:OrmLite執行sql語句
@DatabaseTable
public class Field {
@DatabaseField(generatedId = true)
private long id;
@DatabaseField
private String type;
@ForeignCollectionField(eager = true)
private Collection<FieldListValue> listValue;
...
}
我想以這種方式從表中刪除一些值,如:
List<Field> fields = fieldDao.queryForAll();
for (Field field : fields) {
if (field.getType().equals("list") && field.getListValue().size() == 0) {
fieldDao.delete(field);
}
}
但我怎麼能與DeleteBuilder
執行這個查詢?
與這段代碼的問題...(SELECT COUNT(listValue) FROM Field) = 0
謝謝!它有助於 – winston