package com.casic.dcms.greendao;

import com.casic.dcms.bean.MapConfigBean;
import com.casic.dcms.bean.NoticeLocaleBean;
import com.casic.dcms.bean.ToiletListBean;

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 java.util.Map;

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

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

    private final DaoConfig mapConfigBeanDaoConfig;
    private final DaoConfig noticeLocaleBeanDaoConfig;
    private final DaoConfig toiletListBeanDaoConfig;

    private final MapConfigBeanDao mapConfigBeanDao;
    private final NoticeLocaleBeanDao noticeLocaleBeanDao;
    private final ToiletListBeanDao toiletListBeanDao;

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

        mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone();
        mapConfigBeanDaoConfig.initIdentityScope(type);

        noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone();
        noticeLocaleBeanDaoConfig.initIdentityScope(type);

        toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone();
        toiletListBeanDaoConfig.initIdentityScope(type);

        mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this);
        noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this);
        toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this);

        registerDao(MapConfigBean.class, mapConfigBeanDao);
        registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao);
        registerDao(ToiletListBean.class, toiletListBeanDao);
    }

    public void clear() {
        mapConfigBeanDaoConfig.clearIdentityScope();
        noticeLocaleBeanDaoConfig.clearIdentityScope();
        toiletListBeanDaoConfig.clearIdentityScope();
    }

    public MapConfigBeanDao getMapConfigBeanDao() {
        return mapConfigBeanDao;
    }

    public NoticeLocaleBeanDao getNoticeLocaleBeanDao() {
        return noticeLocaleBeanDao;
    }

    public ToiletListBeanDao getToiletListBeanDao() {
        return toiletListBeanDao;
    }

}
