package com.example.sleep.database.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.example.sleep.database.RecordBean;
import com.example.sleep.database.RemindBean;
import com.example.sleep.database.UserBean;

import com.example.sleep.database.dao.RecordBeanDao;
import com.example.sleep.database.dao.RemindBeanDao;
import com.example.sleep.database.dao.UserBeanDao;

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

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

    private final DaoConfig recordBeanDaoConfig;
    private final DaoConfig remindBeanDaoConfig;
    private final DaoConfig userBeanDaoConfig;

    private final RecordBeanDao recordBeanDao;
    private final RemindBeanDao remindBeanDao;
    private final UserBeanDao userBeanDao;

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

        recordBeanDaoConfig = daoConfigMap.get(RecordBeanDao.class).clone();
        recordBeanDaoConfig.initIdentityScope(type);

        remindBeanDaoConfig = daoConfigMap.get(RemindBeanDao.class).clone();
        remindBeanDaoConfig.initIdentityScope(type);

        userBeanDaoConfig = daoConfigMap.get(UserBeanDao.class).clone();
        userBeanDaoConfig.initIdentityScope(type);

        recordBeanDao = new RecordBeanDao(recordBeanDaoConfig, this);
        remindBeanDao = new RemindBeanDao(remindBeanDaoConfig, this);
        userBeanDao = new UserBeanDao(userBeanDaoConfig, this);

        registerDao(RecordBean.class, recordBeanDao);
        registerDao(RemindBean.class, remindBeanDao);
        registerDao(UserBean.class, userBeanDao);
    }
    
    public void clear() {
        recordBeanDaoConfig.clearIdentityScope();
        remindBeanDaoConfig.clearIdentityScope();
        userBeanDaoConfig.clearIdentityScope();
    }

    public RecordBeanDao getRecordBeanDao() {
        return recordBeanDao;
    }

    public RemindBeanDao getRemindBeanDao() {
        return remindBeanDao;
    }

    public UserBeanDao getUserBeanDao() {
        return userBeanDao;
    }

}
