package com.casic.common.detector.gd.greendao;

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.casic.common.detector.gd.bean.MarkerLocalBean;
import com.casic.common.detector.gd.bean.TaskLocalBean;
import com.casic.common.detector.gd.bean.TaskMarkerLocalBean;

import com.casic.common.detector.gd.greendao.MarkerLocalBeanDao;
import com.casic.common.detector.gd.greendao.TaskLocalBeanDao;
import com.casic.common.detector.gd.greendao.TaskMarkerLocalBeanDao;

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

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

    private final DaoConfig markerLocalBeanDaoConfig;
    private final DaoConfig taskLocalBeanDaoConfig;
    private final DaoConfig taskMarkerLocalBeanDaoConfig;

    private final MarkerLocalBeanDao markerLocalBeanDao;
    private final TaskLocalBeanDao taskLocalBeanDao;
    private final TaskMarkerLocalBeanDao taskMarkerLocalBeanDao;

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

        markerLocalBeanDaoConfig = daoConfigMap.get(MarkerLocalBeanDao.class).clone();
        markerLocalBeanDaoConfig.initIdentityScope(type);

        taskLocalBeanDaoConfig = daoConfigMap.get(TaskLocalBeanDao.class).clone();
        taskLocalBeanDaoConfig.initIdentityScope(type);

        taskMarkerLocalBeanDaoConfig = daoConfigMap.get(TaskMarkerLocalBeanDao.class).clone();
        taskMarkerLocalBeanDaoConfig.initIdentityScope(type);

        markerLocalBeanDao = new MarkerLocalBeanDao(markerLocalBeanDaoConfig, this);
        taskLocalBeanDao = new TaskLocalBeanDao(taskLocalBeanDaoConfig, this);
        taskMarkerLocalBeanDao = new TaskMarkerLocalBeanDao(taskMarkerLocalBeanDaoConfig, this);

        registerDao(MarkerLocalBean.class, markerLocalBeanDao);
        registerDao(TaskLocalBean.class, taskLocalBeanDao);
        registerDao(TaskMarkerLocalBean.class, taskMarkerLocalBeanDao);
    }
    
    public void clear() {
        markerLocalBeanDaoConfig.clearIdentityScope();
        taskLocalBeanDaoConfig.clearIdentityScope();
        taskMarkerLocalBeanDaoConfig.clearIdentityScope();
    }

    public MarkerLocalBeanDao getMarkerLocalBeanDao() {
        return markerLocalBeanDao;
    }

    public TaskLocalBeanDao getTaskLocalBeanDao() {
        return taskLocalBeanDao;
    }

    public TaskMarkerLocalBeanDao getTaskMarkerLocalBeanDao() {
        return taskMarkerLocalBeanDao;
    }

}
