I understand the ORMLite Android examples. However, I have more than one class that I want to map with the ORMlite.
In the example to create the table which match with “SimpleData” class we used this :
public void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {
try {
Log.i(DatabaseHelper.class.getName(), "onCreate");
TableUtils.createTable(connectionSource, SimpleData.class);
}
catch (SQLException e) {
Log.e(DatabaseHelper.class.getName(), "Can't create database", e);
throw new RuntimeException(e);
}
How can I create all my tables (which matches my classes) ?
the same way you created the first one: with multiple calls of TableUtils.createTable method, to whom you’ll pass the class representing the table in database