I'm using SugarORM to help with SQLite in an Android app. I am using the code below to add new rows to a table:
MyTable d = new MyTable("Row1_Title",valueRow1,stockRow1);
d.save();
MyTable d2 = new MyTable("Row2_Title",valueRow2,stockRow2);
d2.save();
MyTable d3 = new MyTable("Row3_Title",valueRow3,stockRow3);
d3.save();
MyTable d4 = new MyTable("Row4_Title",valueRow4,stockRow4);
d4.save();
MyTable d5 = new MyTable("Row5_Title",valueRow5,stockRow5);
d5.save();
MyTable d6 = new MyTable("Row6_Title",valueRow6,stockRow6);
d6.save();
MyTable d7 = new MyTable("Row7_Title",valueRow7,stockRow7);
d7.save();
MyTable Constructor
public MyTable(String title, int value, int stock){
this.title = title;
this.value = value;
this.stock = stock;
}
This all works fine, but is this the right way to instantiate a class multiple times? It seems like I should be able to combine the instantiating in some way?
Thanks