package com.zhangke.shizhong.db;

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.zhangke.shizhong.db.ApplicationInfo;
import com.zhangke.shizhong.db.ClockPlan;
import com.zhangke.shizhong.db.ClockRecord;
import com.zhangke.shizhong.db.RationPlan;
import com.zhangke.shizhong.db.RationRecord;
import com.zhangke.shizhong.db.Todo;

import com.zhangke.shizhong.db.ApplicationInfoDao;
import com.zhangke.shizhong.db.ClockPlanDao;
import com.zhangke.shizhong.db.ClockRecordDao;
import com.zhangke.shizhong.db.RationPlanDao;
import com.zhangke.shizhong.db.RationRecordDao;
import com.zhangke.shizhong.db.TodoDao;

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

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

    private final DaoConfig applicationInfoDaoConfig;
    private final DaoConfig clockPlanDaoConfig;
    private final DaoConfig clockRecordDaoConfig;
    private final DaoConfig rationPlanDaoConfig;
    private final DaoConfig rationRecordDaoConfig;
    private final DaoConfig todoDaoConfig;

    private final ApplicationInfoDao applicationInfoDao;
    private final ClockPlanDao clockPlanDao;
    private final ClockRecordDao clockRecordDao;
    private final RationPlanDao rationPlanDao;
    private final RationRecordDao rationRecordDao;
    private final TodoDao todoDao;

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

        applicationInfoDaoConfig = daoConfigMap.get(ApplicationInfoDao.class).clone();
        applicationInfoDaoConfig.initIdentityScope(type);

        clockPlanDaoConfig = daoConfigMap.get(ClockPlanDao.class).clone();
        clockPlanDaoConfig.initIdentityScope(type);

        clockRecordDaoConfig = daoConfigMap.get(ClockRecordDao.class).clone();
        clockRecordDaoConfig.initIdentityScope(type);

        rationPlanDaoConfig = daoConfigMap.get(RationPlanDao.class).clone();
        rationPlanDaoConfig.initIdentityScope(type);

        rationRecordDaoConfig = daoConfigMap.get(RationRecordDao.class).clone();
        rationRecordDaoConfig.initIdentityScope(type);

        todoDaoConfig = daoConfigMap.get(TodoDao.class).clone();
        todoDaoConfig.initIdentityScope(type);

        applicationInfoDao = new ApplicationInfoDao(applicationInfoDaoConfig, this);
        clockPlanDao = new ClockPlanDao(clockPlanDaoConfig, this);
        clockRecordDao = new ClockRecordDao(clockRecordDaoConfig, this);
        rationPlanDao = new RationPlanDao(rationPlanDaoConfig, this);
        rationRecordDao = new RationRecordDao(rationRecordDaoConfig, this);
        todoDao = new TodoDao(todoDaoConfig, this);

        registerDao(ApplicationInfo.class, applicationInfoDao);
        registerDao(ClockPlan.class, clockPlanDao);
        registerDao(ClockRecord.class, clockRecordDao);
        registerDao(RationPlan.class, rationPlanDao);
        registerDao(RationRecord.class, rationRecordDao);
        registerDao(Todo.class, todoDao);
    }
    
    public void clear() {
        applicationInfoDaoConfig.clearIdentityScope();
        clockPlanDaoConfig.clearIdentityScope();
        clockRecordDaoConfig.clearIdentityScope();
        rationPlanDaoConfig.clearIdentityScope();
        rationRecordDaoConfig.clearIdentityScope();
        todoDaoConfig.clearIdentityScope();
    }

    public ApplicationInfoDao getApplicationInfoDao() {
        return applicationInfoDao;
    }

    public ClockPlanDao getClockPlanDao() {
        return clockPlanDao;
    }

    public ClockRecordDao getClockRecordDao() {
        return clockRecordDao;
    }

    public RationPlanDao getRationPlanDao() {
        return rationPlanDao;
    }

    public RationRecordDao getRationRecordDao() {
        return rationRecordDao;
    }

    public TodoDao getTodoDao() {
        return todoDao;
    }

}
