// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/db/sqliteAsset/AssetSQLiteOpenHelperFactory.java
// @SuppressWarnings("unused")
// public class AssetSQLiteOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
//     @Override
//     public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
//         return new AssetSQLiteOpenHelper(
//                 configuration.context, configuration.name, null,
//                 configuration.version, configuration.errorHandler, configuration.callback
//         );
//     }
// }


import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;
import android.arch.persistence.room.RoomDatabase;
import android.content.Context;
import com.jaus.albertogiunta.justintrain_oraritreni.db.sqliteAsset.AssetSQLiteOpenHelperFactory;
package com.jaus.albertogiunta.justintrain_oraritreni.db;



@Database(entities = {Station.class}, version = 3)
public abstract class AppDatabase extends RoomDatabase {

    private static AppDatabase INSTANCE;

    public abstract StationDaoRoom stationDao();

    public static AppDatabase getAppDatabase(Context context, boolean force) {
        if (INSTANCE == null || force) {

            INSTANCE =
                    Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "justintrain.db")
                            // allow queries on the main thread.
                            // Don't do\ this on a real app! See PersistenceBasicSample for an example.
// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/db/sqliteAsset/AssetSQLiteOpenHelperFactory.java
// @SuppressWarnings("unused")
// public class AssetSQLiteOpenHelperFactory implements SupportSQLiteOpenHelper.Factory {
//     @Override
//     public SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
//         return new AssetSQLiteOpenHelper(
//                 configuration.context, configuration.name, null,
//                 configuration.version, configuration.errorHandler, configuration.callback
//         );
//     }
// }


// Path: app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/db/AppDatabase.java
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;
import android.arch.persistence.room.RoomDatabase;
import android.content.Context;
import com.jaus.albertogiunta.justintrain_oraritreni.db.sqliteAsset.AssetSQLiteOpenHelperFactory;

package com.jaus.albertogiunta.justintrain_oraritreni.db;



@Database(entities = {Station.class}, version = 3)
public abstract class AppDatabase extends RoomDatabase {

    private static AppDatabase INSTANCE;

    public abstract StationDaoRoom stationDao();

    public static AppDatabase getAppDatabase(Context context, boolean force) {
        if (INSTANCE == null || force) {

            INSTANCE =
                    Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "justintrain.db")
                            // allow queries on the main thread.
                            // Don't do\ this on a real app! See PersistenceBasicSample for an example.
                            .openHelperFactory(new AssetSQLiteOpenHelperFactory())