package com.d.music.data.database.greendao.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import de.greenrobot.dao.AbstractDaoMaster;
import de.greenrobot.dao.identityscope.IdentityScopeType;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * Master of DAO (schema version 1): knows all DAOs.
 */
public class DaoMaster extends AbstractDaoMaster {
    public static final int SCHEMA_VERSION = 1;

    public DaoMaster(SQLiteDatabase db) {
        super(db, SCHEMA_VERSION);
        registerDaoClass(MusicModelDao.class);
        registerDaoClass(LocalAllMusicDao.class);
        registerDaoClass(CollectionMusicDao.class);
        registerDaoClass(CustomListModelDao.class);
        registerDaoClass(CustomMusic0Dao.class);
        registerDaoClass(CustomMusic1Dao.class);
        registerDaoClass(CustomMusic2Dao.class);
        registerDaoClass(CustomMusic3Dao.class);
        registerDaoClass(CustomMusic4Dao.class);
        registerDaoClass(CustomMusic5Dao.class);
        registerDaoClass(CustomMusic6Dao.class);
        registerDaoClass(CustomMusic7Dao.class);
        registerDaoClass(CustomMusic8Dao.class);
        registerDaoClass(CustomMusic9Dao.class);
        registerDaoClass(CustomMusic10Dao.class);
        registerDaoClass(CustomMusic11Dao.class);
        registerDaoClass(CustomMusic12Dao.class);
        registerDaoClass(CustomMusic13Dao.class);
        registerDaoClass(CustomMusic14Dao.class);
        registerDaoClass(CustomMusic15Dao.class);
        registerDaoClass(CustomMusic16Dao.class);
        registerDaoClass(CustomMusic17Dao.class);
        registerDaoClass(CustomMusic18Dao.class);
        registerDaoClass(CustomMusic19Dao.class);
        registerDaoClass(TransferModelDao.class);
    }

    /**
     * Creates underlying database table using DAOs.
     */
    public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
        MusicModelDao.createTable(db, ifNotExists);
        LocalAllMusicDao.createTable(db, ifNotExists);
        CollectionMusicDao.createTable(db, ifNotExists);
        CustomListModelDao.createTable(db, ifNotExists);
        CustomMusic0Dao.createTable(db, ifNotExists);
        CustomMusic1Dao.createTable(db, ifNotExists);
        CustomMusic2Dao.createTable(db, ifNotExists);
        CustomMusic3Dao.createTable(db, ifNotExists);
        CustomMusic4Dao.createTable(db, ifNotExists);
        CustomMusic5Dao.createTable(db, ifNotExists);
        CustomMusic6Dao.createTable(db, ifNotExists);
        CustomMusic7Dao.createTable(db, ifNotExists);
        CustomMusic8Dao.createTable(db, ifNotExists);
        CustomMusic9Dao.createTable(db, ifNotExists);
        CustomMusic10Dao.createTable(db, ifNotExists);
        CustomMusic11Dao.createTable(db, ifNotExists);
        CustomMusic12Dao.createTable(db, ifNotExists);
        CustomMusic13Dao.createTable(db, ifNotExists);
        CustomMusic14Dao.createTable(db, ifNotExists);
        CustomMusic15Dao.createTable(db, ifNotExists);
        CustomMusic16Dao.createTable(db, ifNotExists);
        CustomMusic17Dao.createTable(db, ifNotExists);
        CustomMusic18Dao.createTable(db, ifNotExists);
        CustomMusic19Dao.createTable(db, ifNotExists);
        TransferModelDao.createTable(db, ifNotExists);
    }

    /**
     * Drops underlying database table using DAOs.
     */
    public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
        MusicModelDao.dropTable(db, ifExists);
        LocalAllMusicDao.dropTable(db, ifExists);
        CollectionMusicDao.dropTable(db, ifExists);
        CustomListModelDao.dropTable(db, ifExists);
        CustomMusic0Dao.dropTable(db, ifExists);
        CustomMusic1Dao.dropTable(db, ifExists);
        CustomMusic2Dao.dropTable(db, ifExists);
        CustomMusic3Dao.dropTable(db, ifExists);
        CustomMusic4Dao.dropTable(db, ifExists);
        CustomMusic5Dao.dropTable(db, ifExists);
        CustomMusic6Dao.dropTable(db, ifExists);
        CustomMusic7Dao.dropTable(db, ifExists);
        CustomMusic8Dao.dropTable(db, ifExists);
        CustomMusic9Dao.dropTable(db, ifExists);
        CustomMusic10Dao.dropTable(db, ifExists);
        CustomMusic11Dao.dropTable(db, ifExists);
        CustomMusic12Dao.dropTable(db, ifExists);
        CustomMusic13Dao.dropTable(db, ifExists);
        CustomMusic14Dao.dropTable(db, ifExists);
        CustomMusic15Dao.dropTable(db, ifExists);
        CustomMusic16Dao.dropTable(db, ifExists);
        CustomMusic17Dao.dropTable(db, ifExists);
        CustomMusic18Dao.dropTable(db, ifExists);
        CustomMusic19Dao.dropTable(db, ifExists);
        TransferModelDao.dropTable(db, ifExists);
    }

    public DaoSession newSession() {
        return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
    }

    public DaoSession newSession(IdentityScopeType type) {
        return new DaoSession(db, type, daoConfigMap);
    }

    public static abstract class OpenHelper extends SQLiteOpenHelper {

        public OpenHelper(Context context, String name, CursorFactory factory) {
            super(context, name, factory, SCHEMA_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
            createAllTables(db, false);
        }
    }

    /**
     * WARNING: Drops all table on Upgrade! Use only during development.
     */
    public static class DevOpenHelper extends OpenHelper {
        public DevOpenHelper(Context context, String name, CursorFactory factory) {
            super(context, name, factory);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
            dropAllTables(db, true);
            onCreate(db);
        }
    }

}
