package com.kfzs.duanduan.data.graph.provider.channel;

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.kfzs.duanduan.data.graph.provider.channel.Channel;
import com.kfzs.duanduan.data.graph.provider.current.Current;
import com.kfzs.duanduan.data.graph.provider.player.User;
import com.kfzs.duanduan.datashare.provider.appdownload.AppdownloadBean;
import com.kfzs.duanduan.datashare.provider.download.DownLoadInfo;

import com.kfzs.duanduan.data.graph.provider.channel.ChannelDao;
import com.kfzs.duanduan.data.graph.provider.current.CurrentDao;
import com.kfzs.duanduan.data.graph.provider.player.UserDao;
import com.kfzs.duanduan.datashare.provider.appdownload.AppdownloadBeanDao;
import com.kfzs.duanduan.datashare.provider.download.DownLoadInfoDao;

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

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

    private final DaoConfig channelDaoConfig;
    private final DaoConfig currentDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig appdownloadBeanDaoConfig;
    private final DaoConfig downLoadInfoDaoConfig;

    private final ChannelDao channelDao;
    private final CurrentDao currentDao;
    private final UserDao userDao;
    private final AppdownloadBeanDao appdownloadBeanDao;
    private final DownLoadInfoDao downLoadInfoDao;

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

        channelDaoConfig = daoConfigMap.get(ChannelDao.class).clone();
        channelDaoConfig.initIdentityScope(type);

        currentDaoConfig = daoConfigMap.get(CurrentDao.class).clone();
        currentDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
        appdownloadBeanDaoConfig.initIdentityScope(type);

        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
        downLoadInfoDaoConfig.initIdentityScope(type);

        channelDao = new ChannelDao(channelDaoConfig, this);
        currentDao = new CurrentDao(currentDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);

        registerDao(Channel.class, channelDao);
        registerDao(Current.class, currentDao);
        registerDao(User.class, userDao);
        registerDao(AppdownloadBean.class, appdownloadBeanDao);
        registerDao(DownLoadInfo.class, downLoadInfoDao);
    }
    
    public void clear() {
        channelDaoConfig.clearIdentityScope();
        currentDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        appdownloadBeanDaoConfig.clearIdentityScope();
        downLoadInfoDaoConfig.clearIdentityScope();
    }

    public ChannelDao getChannelDao() {
        return channelDao;
    }

    public CurrentDao getCurrentDao() {
        return currentDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public AppdownloadBeanDao getAppdownloadBeanDao() {
        return appdownloadBeanDao;
    }

    public DownLoadInfoDao getDownLoadInfoDao() {
        return downLoadInfoDao;
    }

}
