I am getting this compile error when I try this query.
尚不支持插入查询类型。您可以使用:选择,删除, 更新
@Query("INSERT INTO table SELECT name, etc from temp_table;")
void insertIntoTable();
还有其他方法可以进行批处理插入吗?
我能够使用RAWQUERY:
public void addRecordsFromTempTable() {
mDatabase.rawDao().insertRecords(new SimpleSQLiteQuery("INSERT INTO my_table (name, etc) SELECT name, et from temp_table;"));
}
原始查询文件:
@Dao
public interface RawDao {
@RawQuery()
boolean insertRecords(SupportSQLiteQuery query);