package com.casic.detector.greendao;

import com.casic.detector.bean.LabelBean;
import com.casic.detector.bean.SmallLabelBean;
import com.casic.detector.bean.TaskBean;

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 labelBeanDaoConfig;
    private final DaoConfig smallLabelBeanDaoConfig;
    private final DaoConfig taskBeanDaoConfig;

    private final LabelBeanDao labelBeanDao;
    private final SmallLabelBeanDao smallLabelBeanDao;
    private final TaskBeanDao taskBeanDao;

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

        labelBeanDaoConfig = daoConfigMap.get(LabelBeanDao.class).clone();
        labelBeanDaoConfig.initIdentityScope(type);

        smallLabelBeanDaoConfig = daoConfigMap.get(SmallLabelBeanDao.class).clone();
        smallLabelBeanDaoConfig.initIdentityScope(type);

        taskBeanDaoConfig = daoConfigMap.get(TaskBeanDao.class).clone();
        taskBeanDaoConfig.initIdentityScope(type);

        labelBeanDao = new LabelBeanDao(labelBeanDaoConfig, this);
        smallLabelBeanDao = new SmallLabelBeanDao(smallLabelBeanDaoConfig, this);
        taskBeanDao = new TaskBeanDao(taskBeanDaoConfig, this);

        registerDao(LabelBean.class, labelBeanDao);
        registerDao(SmallLabelBean.class, smallLabelBeanDao);
        registerDao(TaskBean.class, taskBeanDao);
    }
    
    public void clear() {
        labelBeanDaoConfig.clearIdentityScope();
        smallLabelBeanDaoConfig.clearIdentityScope();
        taskBeanDaoConfig.clearIdentityScope();
    }

    public LabelBeanDao getLabelBeanDao() {
        return labelBeanDao;
    }

    public SmallLabelBeanDao getSmallLabelBeanDao() {
        return smallLabelBeanDao;
    }

    public TaskBeanDao getTaskBeanDao() {
        return taskBeanDao;
    }

}
