Search in sources :

Example 1 with DataSupport

use of org.litepal.crud.DataSupport in project LitePal by LitePalFramework.

the class Many2ManySaveTest method saveAllByRandom.

private void saveAllByRandom() {
    List<DataSupport> modelList = getModelList();
    while (!modelList.isEmpty()) {
        Random rand = new Random();
        int index = rand.nextInt(modelList.size());
        DataSupport model = modelList.remove(index);
        model.save();
    }
}
Also used : Random(java.util.Random) DataSupport(org.litepal.crud.DataSupport)

Aggregations

Random (java.util.Random)1 DataSupport (org.litepal.crud.DataSupport)1