package com.zlm.hp.db.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zlm.down.entity.DownloadTask;
import com.zlm.down.entity.DownloadThreadInfo;
import com.zlm.hp.entity.AudioInfo;
import com.zlm.hp.entity.SingerInfo;
import com.zlm.hp.entity.VideoInfo;

import com.zlm.hp.db.dao.DownloadTaskDao;
import com.zlm.hp.db.dao.DownloadThreadInfoDao;
import com.zlm.hp.db.dao.AudioInfoDao;
import com.zlm.hp.db.dao.SingerInfoDao;
import com.zlm.hp.db.dao.VideoInfoDao;

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

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig downloadTaskDaoConfig;
    private final DaoConfig downloadThreadInfoDaoConfig;
    private final DaoConfig audioInfoDaoConfig;
    private final DaoConfig singerInfoDaoConfig;
    private final DaoConfig videoInfoDaoConfig;

    private final DownloadTaskDao downloadTaskDao;
    private final DownloadThreadInfoDao downloadThreadInfoDao;
    private final AudioInfoDao audioInfoDao;
    private final SingerInfoDao singerInfoDao;
    private final VideoInfoDao videoInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        downloadTaskDaoConfig = daoConfigMap.get(DownloadTaskDao.class).clone();
        downloadTaskDaoConfig.initIdentityScope(type);

        downloadThreadInfoDaoConfig = daoConfigMap.get(DownloadThreadInfoDao.class).clone();
        downloadThreadInfoDaoConfig.initIdentityScope(type);

        audioInfoDaoConfig = daoConfigMap.get(AudioInfoDao.class).clone();
        audioInfoDaoConfig.initIdentityScope(type);

        singerInfoDaoConfig = daoConfigMap.get(SingerInfoDao.class).clone();
        singerInfoDaoConfig.initIdentityScope(type);

        videoInfoDaoConfig = daoConfigMap.get(VideoInfoDao.class).clone();
        videoInfoDaoConfig.initIdentityScope(type);

        downloadTaskDao = new DownloadTaskDao(downloadTaskDaoConfig, this);
        downloadThreadInfoDao = new DownloadThreadInfoDao(downloadThreadInfoDaoConfig, this);
        audioInfoDao = new AudioInfoDao(audioInfoDaoConfig, this);
        singerInfoDao = new SingerInfoDao(singerInfoDaoConfig, this);
        videoInfoDao = new VideoInfoDao(videoInfoDaoConfig, this);

        registerDao(DownloadTask.class, downloadTaskDao);
        registerDao(DownloadThreadInfo.class, downloadThreadInfoDao);
        registerDao(AudioInfo.class, audioInfoDao);
        registerDao(SingerInfo.class, singerInfoDao);
        registerDao(VideoInfo.class, videoInfoDao);
    }
    
    public void clear() {
        downloadTaskDaoConfig.clearIdentityScope();
        downloadThreadInfoDaoConfig.clearIdentityScope();
        audioInfoDaoConfig.clearIdentityScope();
        singerInfoDaoConfig.clearIdentityScope();
        videoInfoDaoConfig.clearIdentityScope();
    }

    public DownloadTaskDao getDownloadTaskDao() {
        return downloadTaskDao;
    }

    public DownloadThreadInfoDao getDownloadThreadInfoDao() {
        return downloadThreadInfoDao;
    }

    public AudioInfoDao getAudioInfoDao() {
        return audioInfoDao;
    }

    public SingerInfoDao getSingerInfoDao() {
        return singerInfoDao;
    }

    public VideoInfoDao getVideoInfoDao() {
        return videoInfoDao;
    }

}
